├── app ├── templates │ ├── advanced_craft_install │ │ ├── craft │ │ │ ├── templates │ │ │ │ ├── 404.html │ │ │ │ └── index.html │ │ │ ├── config │ │ │ │ ├── _db.php │ │ │ │ └── _general.php │ │ │ └── db │ │ │ │ └── dump.sql │ │ ├── _jshintrc │ │ ├── _bower.json │ │ ├── _gitignore │ │ ├── _csslintrc │ │ └── _package.json │ ├── basic_craft_install │ │ └── craft │ │ │ ├── templates │ │ │ ├── 404.html │ │ │ └── index.html │ │ │ ├── storage │ │ │ └── _gitignore │ │ │ └── config │ │ │ ├── _db.php │ │ │ └── _general.php │ ├── basic_craft_install.json │ └── advanced_craft_install.json └── index.js ├── package.json ├── .gitignore ├── LICENSE.txt └── README.md /app/templates/advanced_craft_install/craft/templates/404.html: -------------------------------------------------------------------------------- 1 | 404, world! -------------------------------------------------------------------------------- /app/templates/basic_craft_install/craft/templates/404.html: -------------------------------------------------------------------------------- 1 | 404, world! -------------------------------------------------------------------------------- /app/templates/basic_craft_install/craft/templates/index.html: -------------------------------------------------------------------------------- 1 | hello, world! -------------------------------------------------------------------------------- /app/templates/advanced_craft_install/craft/templates/index.html: -------------------------------------------------------------------------------- 1 | hello, world! -------------------------------------------------------------------------------- /app/templates/basic_craft_install/craft/storage/_gitignore: -------------------------------------------------------------------------------- 1 | # Ignore everything in this directory 2 | * 3 | # Except this file 4 | !.gitignore -------------------------------------------------------------------------------- /app/templates/advanced_craft_install/_jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "node": true, 3 | "esnext": true, 4 | "bitwise": true, 5 | "camelcase": true, 6 | "curly": true, 7 | "eqeqeq": true, 8 | "immed": true, 9 | "indent": 2, 10 | "latedef": true, 11 | "newcap": true, 12 | "noarg": true, 13 | "quotmark": "single", 14 | "regexp": true, 15 | "undef": true, 16 | "unused": true, 17 | "strict": true, 18 | "trailing": true, 19 | "smarttabs": true, 20 | "white": true 21 | } 22 | -------------------------------------------------------------------------------- /app/templates/advanced_craft_install/_bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "<%= appName %>", 3 | "version": "1.0.0", 4 | "dependencies": { 5 | "animate.css": "^3.4.0", 6 | "bpopup": "bpopup#^0.11.0", 7 | "flexboxgrid": "^6.2.0", 8 | "fontfaceobserver": "^1.4.4", 9 | "jquery": "^2.0.0", 10 | "loadcss": "^0.2.4", 11 | "normalize.css": "^3.0.3", 12 | "parsleyjs": "^2.2.0", 13 | "requirejs": "^2.1.15", 14 | "slick.js": "^1.5.8", 15 | "waypoints": "^4.0.0" 16 | }, 17 | "private": true 18 | } 19 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "generator-craftinstall", 3 | "version": "1.1.3", 4 | "description": "generator-craftinstall is a Yeoman generator for Craft CMS installs", 5 | "main": "app/index.js", 6 | "files": [ 7 | "app" 8 | ], 9 | "repository": "nystudio107/generator-craftinstall", 10 | "keywords": [ 11 | "yeoman-generator", 12 | "generator-craftinstall", 13 | "craft-cms", 14 | "craft" 15 | ], 16 | "author": "nystudio107", 17 | "license": "MIT", 18 | "dependencies": { 19 | "ncp": "^2.0.0", 20 | "chalk": "^1.1.1", 21 | "download": "^4.2.1", 22 | "inflection": "^1.7.1", 23 | "yeoman-option-or-prompt": "^1.0.2", 24 | "pleasant-progress": "^1.1.0", 25 | "yeoman-generator": "^0.20.3" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/templates/advanced_craft_install/_gitignore: -------------------------------------------------------------------------------- 1 | # LOCAL CONFIG SETTINGS 2 | # Exclude local config files so we don't overwrite other local setups. 3 | # Leave example files that can be copied to get setup 4 | # ------------------------------------------------------------ 5 | /craft/config/local/* 6 | !/craft/config/local/db.php.example 7 | !/craft/config/local/general.php.example 8 | 9 | # CRAFT STORAGE 10 | # http://buildwithcraft.com/help/craft-storage-gitignore 11 | # ------------------------------------------------------------ 12 | /craft/storage/* 13 | !/craft/storage/.gitignore 14 | !/craft/storage/logo/* 15 | 16 | # MISC FILES 17 | # https://github.com/github/gitignore/tree/master/Global 18 | # ------------------------------------------------------------ 19 | .cache 20 | .DS_Store 21 | .idea 22 | .project 23 | .settings 24 | *.esproj 25 | *.sublime-workspace 26 | *.sublime-project 27 | *.tmproj 28 | *.tmproject 29 | Thumbs.db 30 | /logs/* 31 | 32 | # BUILD FILES 33 | # aaw -- 2015-09-27 34 | /bower_components/* 35 | /node_modules/* 36 | /build/* 37 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # LOCAL CONFIG SETTINGS 2 | # Exclude local config files so we don't overwrite other local setups. 3 | # Leave example files that can be copied to get setup 4 | # ------------------------------------------------------------ 5 | /craft/config/local/* 6 | !/craft/config/local/db.php.example 7 | !/craft/config/local/general.php.example 8 | 9 | # CRAFT STORAGE 10 | # http://buildwithcraft.com/help/craft-storage-gitignore 11 | # ------------------------------------------------------------ 12 | /craft/storage/* 13 | !/craft/storage/.gitignore 14 | !/craft/storage/logo/* 15 | 16 | # MISC FILES 17 | # https://github.com/github/gitignore/tree/master/Global 18 | # ------------------------------------------------------------ 19 | .cache 20 | .DS_Store 21 | .idea 22 | .project 23 | .settings 24 | *.esproj 25 | *.sublime-workspace 26 | *.sublime-project 27 | *.tmproj 28 | *.tmproject 29 | Thumbs.db 30 | /logs/* 31 | 32 | # BUILD FILES 33 | # aaw -- 2015-09-27 34 | /bower_components/* 35 | /node_modules/* 36 | /build/* 37 | npm-debug.log 38 | /app/templates/nystudio107* 39 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | Copyright (c) 2015-2016 nystudio107 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 5 | 6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 7 | 8 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /app/templates/advanced_craft_install/_csslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "important": false, 3 | "adjoining-classes": false, 4 | "known-properties": false, 5 | "box-sizing": false, 6 | "box-model": false, 7 | "overqualified-elements": false, 8 | "display-property-grouping": false, 9 | "bulletproof-font-face": false, 10 | "compatible-vendor-prefixes": false, 11 | "regex-selectors": false, 12 | "errors": true, 13 | "duplicate-background-images": false, 14 | "duplicate-properties": false, 15 | "empty-rules": false, 16 | "selector-max-approaching": false, 17 | "gradients": false, 18 | "fallback-colors": false, 19 | "font-sizes": false, 20 | "font-faces": false, 21 | "floats": false, 22 | "star-property-hack": false, 23 | "outline-none": false, 24 | "import": false, 25 | "ids": false, 26 | "underscore-property-hack": false, 27 | "rules-count": false, 28 | "qualified-headings": false, 29 | "selector-max": false, 30 | "shorthand": false, 31 | "text-indent": false, 32 | "unique-headings": false, 33 | "universal-selector": false, 34 | "unqualified-attributes": false, 35 | "vendor-prefix": false, 36 | "zero-units": false 37 | } -------------------------------------------------------------------------------- /app/templates/advanced_craft_install/_package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "<%= appName %>", 3 | "title": "build assets", 4 | "version": "1.0.0", 5 | "dist_path": "public/", 6 | "build_path": "build/", 7 | "template_path": "craft/templates/", 8 | "site_url": "http://<%= appName %>.dev/", 9 | "devDependencies": { 10 | "grunt": "^0.4.5", 11 | "grunt-autoprefixer": "^3.0.3", 12 | "grunt-base64": "^0.1.0", 13 | "grunt-contrib-clean": "^0.7.0", 14 | "grunt-contrib-concat": "^0.5.1", 15 | "grunt-contrib-copy": "^0.8.2", 16 | "grunt-contrib-csslint": "^0.5.0", 17 | "grunt-contrib-cssmin": "^0.14.0", 18 | "grunt-contrib-imagemin": "^1.0.0", 19 | "grunt-contrib-less": "^1.1.0", 20 | "grunt-contrib-requirejs": "^0.4.4", 21 | "grunt-contrib-uglify": "^0.11.0", 22 | "grunt-contrib-watch": "^0.6.1", 23 | "grunt-critical": "^0.1.7", 24 | "grunt-css-url-embed": "^1.6.1", 25 | "grunt-curl": "^2.2.0", 26 | "grunt-exec": "^0.4.6", 27 | "grunt-favicons": "^0.7.0", 28 | "grunt-fontello": "^0.1.3", 29 | "grunt-newer": "^1.1.0", 30 | "grunt-rev": "^0.1.0", 31 | "grunt-text-replace": "^0.4.0", 32 | "grunt-uncss": "^0.4.4", 33 | "grunt-usemin": "^3.1.1" 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /app/templates/advanced_craft_install/craft/config/_db.php: -------------------------------------------------------------------------------- 1 | array( 15 | // The prefix to use when naming tables. This can be no more than 5 characters. 16 | 'tablePrefix' => 'craft', 17 | ), 18 | 19 | /* -- <%= appName %>.dev developmental settings */ 20 | 21 | '<%= appName %>.dev' => array( 22 | 23 | // The database server name or IP address. Usually this is 'localhost' or '127.0.0.1'. 24 | 'server' => 'localhost', 25 | 26 | // The database username to connect with. 27 | 'user' => 'homestead', 28 | 29 | // The database password to connect with. 30 | 'password' => 'secret', 31 | 32 | // The name of the database to select. 33 | 'database' => '<%= appName %>', 34 | 35 | ), 36 | 37 | /* -- <%= appName %>.com production settings */ 38 | 39 | '<%= appName %>.com' => array( 40 | 41 | // The database server name or IP address. Usually this is 'localhost' or '127.0.0.1'. 42 | 'server' => 'localhost', 43 | 44 | // The database username to connect with. 45 | 'user' => '<%= appName %>', 46 | 47 | // The database password to connect with. 48 | 'password' => 'secret', 49 | 50 | // The name of the database to select. 51 | 'database' => '<%= appName %>', 52 | ), 53 | 54 | ); 55 | -------------------------------------------------------------------------------- /app/templates/basic_craft_install/craft/config/_db.php: -------------------------------------------------------------------------------- 1 | array( 15 | // The prefix to use when naming tables. This can be no more than 5 characters. 16 | 'tablePrefix' => 'craft', 17 | ), 18 | 19 | /* -- <%= appName %>.dev developmental settings */ 20 | 21 | '<%= appName %>.dev' => array( 22 | 23 | // The database server name or IP address. Usually this is 'localhost' or '127.0.0.1'. 24 | 'server' => 'localhost', 25 | 26 | // The database username to connect with. 27 | 'user' => 'homestead', 28 | 29 | // The database password to connect with. 30 | 'password' => 'secret', 31 | 32 | // The name of the database to select. 33 | 'database' => '<%= appName %>', 34 | 35 | ), 36 | 37 | /* -- <%= appName %>.com production settings */ 38 | 39 | '<%= appName %>.com' => array( 40 | 41 | // The database server name or IP address. Usually this is 'localhost' or '127.0.0.1'. 42 | 'server' => 'localhost', 43 | 44 | // The database username to connect with. 45 | 'user' => '<%= appName %>', 46 | 47 | // The database password to connect with. 48 | 'password' => 'secret', 49 | 50 | // The name of the database to select. 51 | 'database' => '<%= appName %>', 52 | ), 53 | 54 | ); 55 | -------------------------------------------------------------------------------- /app/templates/advanced_craft_install/craft/config/_general.php: -------------------------------------------------------------------------------- 1 | array( 15 | 16 | 'autoLoginAfterAccountActivation' => true, 17 | 18 | 'omitScriptNameInUrls' => true, 19 | 'generateTransformsBeforePageLoad' => true, 20 | 21 | 'rememberedUserSessionDuration' => 'P1Y', 22 | 'userSessionDuration' => 'P1D', 23 | 24 | 'maxUploadFileSize' => 104857600, 25 | ), 26 | 27 | /* -- <%= appName %>.dev developmental settings */ 28 | 29 | '<%= appName %>.dev' => array( 30 | 31 | 'siteUrl' => 'http://<%= appName %>.dev/', 32 | 'devMode' => true, 33 | 'enableTemplateCaching' => false, 34 | 'environmentVariables' => array( 35 | 'staticAssetsVersion' => time(), 36 | 'basePath' => '/home/vagrant/sites/<%= installDir %>/', 37 | 'baseUrl' => 'http://<%= appName %>.dev/', 38 | ), 39 | 40 | ), 41 | 42 | /* -- <%= appName %>.com production settings */ 43 | 44 | '<%= appName %>.com' => array( 45 | 46 | 'siteUrl' => 'http://<%= appName %>.com/', 47 | 'devMode' => false, 48 | 'enableTemplateCaching' => true, 49 | 'environmentVariables' => array( 50 | 'staticAssetsVersion' => '2', 51 | 'basePath' => '/htdocs/<%= installDir %>/', 52 | 'baseUrl' => 'http://<%= appName %>.com/', 53 | ), 54 | ), 55 | 56 | ); 57 | -------------------------------------------------------------------------------- /app/templates/basic_craft_install/craft/config/_general.php: -------------------------------------------------------------------------------- 1 | array( 15 | 16 | 'autoLoginAfterAccountActivation' => true, 17 | 18 | 'omitScriptNameInUrls' => true, 19 | 'generateTransformsBeforePageLoad' => true, 20 | 21 | 'rememberedUserSessionDuration' => 'P1Y', 22 | 'userSessionDuration' => 'P1D', 23 | 24 | 'maxUploadFileSize' => 104857600, 25 | ), 26 | 27 | /* -- <%= appName %>.dev developmental settings */ 28 | 29 | '<%= appName %>.dev' => array( 30 | 31 | 'siteUrl' => 'http://<%= appName %>.dev/', 32 | 'devMode' => true, 33 | 'enableTemplateCaching' => false, 34 | 'environmentVariables' => array( 35 | 'staticAssetsVersion' => time(), 36 | 'basePath' => '/home/vagrant/sites/<%= installDir %>/', 37 | 'baseUrl' => 'http://<%= appName %>.dev/', 38 | ), 39 | 40 | ), 41 | 42 | /* -- <%= appName %>.com production settings */ 43 | 44 | '<%= appName %>.com' => array( 45 | 46 | 'siteUrl' => 'http://<%= appName %>.com/', 47 | 'devMode' => false, 48 | 'enableTemplateCaching' => true, 49 | 'environmentVariables' => array( 50 | 'staticAssetsVersion' => '2', 51 | 'basePath' => '/htdocs/<%= installDir %>/', 52 | 'baseUrl' => 'http://<%= appName %>.com/', 53 | ), 54 | ), 55 | 56 | ); 57 | -------------------------------------------------------------------------------- /app/templates/basic_craft_install.json: -------------------------------------------------------------------------------- 1 | { 2 | "INSTALL_NAME": "Basic Craft Install", 3 | "INSTALL_KEY": "basic_craft_install", 4 | "QUESTIONS": [ 5 | { 6 | "name": "appName", 7 | "message": "Application name", 8 | "default": "testapp" 9 | } 10 | ], 11 | "DOWNLOAD_FILES": [ 12 | { 13 | "name": "Craft CMS", 14 | "url": "http://buildwithcraft.com/latest.zip?accept_license=yes" 15 | } 16 | ], 17 | "DELETE_FILES": [ 18 | { 19 | "src": "craft/templates" 20 | }, 21 | { 22 | "src": "craft/config/db.php" 23 | }, 24 | { 25 | "src": "craft/config/general.php" 26 | } 27 | ], 28 | "MOVE_FILES": [ 29 | { 30 | "src": "public/htaccess", 31 | "dest": "public/.htaccess" 32 | } 33 | ], 34 | "TEMPLATE_FILES": [ 35 | { 36 | "src": "craft/config/_db.php", 37 | "dest": "craft/config/db.php" 38 | }, 39 | { 40 | "src": "craft/config/_general.php", 41 | "dest": "craft/config/general.php" 42 | } 43 | ], 44 | "BOILERPLATE_FILES": [ 45 | ], 46 | "BOILERPLATE_DIRECTORIES": [ 47 | { 48 | "src": "craft/templates", 49 | "dest": "craft/templates" 50 | } 51 | ], 52 | "MYSQL_DBS": [ 53 | ], 54 | "CRAFT_PLUGINS": [ 55 | ], 56 | "REMOTE_GIT_ORIGIN": "", 57 | "BOWER_OPTIONS": [ 58 | ], 59 | "NPM_OPTIONS": [ 60 | ], 61 | "END_INSTALL_COMMANDS": [ 62 | { 63 | "name": "Fin.", 64 | "command": "echo 'Fin.'" 65 | } 66 | ] 67 | } -------------------------------------------------------------------------------- /app/templates/advanced_craft_install.json: -------------------------------------------------------------------------------- 1 | { 2 | "INSTALL_NAME": "Advanced Craft Install", 3 | "INSTALL_KEY": "advanced_craft_install", 4 | "QUESTIONS": [ 5 | { 6 | "name": "appName", 7 | "message": "Application name", 8 | "default": "testapp" 9 | } 10 | ], 11 | "DOWNLOAD_FILES": [ 12 | { 13 | "name": "Craft CMS", 14 | "url": "http://buildwithcraft.com/latest.zip?accept_license=yes" 15 | } 16 | ], 17 | "DELETE_FILES": [ 18 | { 19 | "src": "craft/templates" 20 | }, 21 | { 22 | "src": "craft/config/db.php" 23 | }, 24 | { 25 | "src": "craft/config/general.php" 26 | } 27 | ], 28 | "MOVE_FILES": [ 29 | { 30 | "src": "public/htaccess", 31 | "dest": "public/.htaccess" 32 | } 33 | ], 34 | "TEMPLATE_FILES": [ 35 | { 36 | "src": "_bower.json", 37 | "dest": "bower.json" 38 | }, 39 | { 40 | "src": "_package.json", 41 | "dest": "package.json" 42 | }, 43 | { 44 | "src": "craft/config/_db.php", 45 | "dest": "craft/config/db.php" 46 | }, 47 | { 48 | "src": "craft/config/_general.php", 49 | "dest": "craft/config/general.php" 50 | } 51 | ], 52 | "BOILERPLATE_FILES": [ 53 | { 54 | "src": "_csslintrc", 55 | "dest": ".csslintrc" 56 | }, 57 | { 58 | "src": "_gitignore", 59 | "dest": ".gitignore" 60 | }, 61 | { 62 | "src": "_jshintrc", 63 | "dest": ".jshintrc" 64 | } 65 | ], 66 | "BOILERPLATE_DIRECTORIES": [ 67 | { 68 | "src": "craft/templates", 69 | "dest": "craft/templates" 70 | } 71 | ], 72 | "MYSQL_DBS": [ 73 | ], 74 | "CRAFT_PLUGINS": [ 75 | { 76 | "name": "Minify", 77 | "url": "https://github.com/khalwat/minify.git", 78 | "path": "craft/plugins/minify" 79 | }, 80 | { 81 | "name": "Cookies", 82 | "url": "https://github.com/khalwat/cookies.git", 83 | "path": "craft/plugins/cookies" 84 | }, 85 | { 86 | "name": "Retour", 87 | "url": "https://github.com/nystudio107/retour.git", 88 | "path": "craft/plugins/retour" 89 | }, 90 | { 91 | "name": "SEOmatic", 92 | "url": "https://github.com/nystudio107/seomatic.git", 93 | "path": "craft/plugins/seomatic" 94 | } 95 | ], 96 | "REMOTE_GIT_ORIGIN": "", 97 | "BOWER_OPTIONS": [ 98 | ], 99 | "NPM_OPTIONS": [ 100 | "--no-bin-links" 101 | ], 102 | "END_INSTALL_COMMANDS": [ 103 | { 104 | "name": "Fin.", 105 | "command": "echo 'Fin.'" 106 | } 107 | ] 108 | } -------------------------------------------------------------------------------- /app/index.js: -------------------------------------------------------------------------------- 1 | /* -------------------------------------------------------------------------------- 2 | GENERATOR-NYSTUDIO107 3 | generator-nystudio107 is a Yeoman generator for Craft CMS installs 4 | 5 | Type just `yo nystudio107` and a new Craft CMS project install tailored to 6 | your liking will be created. 7 | -------------------------------------------------------------------------------- */ 8 | 9 | 'use strict'; 10 | 11 | /* -------------------------------------------------------------------------------- 12 | *** Being configuration section *** 13 | -------------------------------------------------------------------------------- */ 14 | 15 | const INSTALL_QUESTIONS = [ 16 | { 17 | type: "list", 18 | name: 'installList', 19 | message: 'Select which install to use:', 20 | choices: [ 21 | ], 22 | store: true 23 | }, 24 | ]; 25 | 26 | const INSTALLS_DIR = "/"; 27 | 28 | var installs = {}; 29 | 30 | 31 | /* -------------------------------------------------------------------------------- 32 | *** End configuration section *** 33 | -------------------------------------------------------------------------------- */ 34 | 35 | var yo = require('yeoman-generator'); 36 | var chalk = require('chalk'); 37 | var download = require('download'); 38 | var pleasant = require('pleasant-progress'); 39 | var fs = require('fs'); 40 | var ncp = require('ncp'); 41 | var child_process = require('child_process'); 42 | var path = require('path'); 43 | var optionOrPrompt = require('yeoman-option-or-prompt'); 44 | 45 | module.exports = yo.generators.Base.extend({ 46 | 47 | _optionOrPrompt: optionOrPrompt, 48 | 49 | /* -- initializing -- Your initialization methods (checking current project state, getting configs, etc) */ 50 | 51 | initializing: function() { 52 | console.log(chalk.yellow.bold('[ Initializing ]')); 53 | 54 | /* -- Process data in an array synchronously, moving onto the n+1 item only after the nth item callback */ 55 | 56 | this.synchronousLoop = function(data, processData, loopDone) { 57 | if (data.length > 0) { 58 | var loop = function(data, i, processData, loopDone) { 59 | processData(data[i], i, function() { 60 | if (++i < data.length) { 61 | loop(data, i, processData, loopDone); 62 | } else { 63 | loopDone(); 64 | } 65 | }); 66 | }; 67 | loop(data, 0, processData, loopDone); 68 | } else { 69 | loopDone(); 70 | } 71 | }; 72 | 73 | /* -- Set up the download command */ 74 | 75 | this.download = function(url, cb) { 76 | var self = this; 77 | new download({mode: '775', extract: true}) 78 | .get(url) 79 | .dest(this.destinationPath()) 80 | .run(function(error, files) { 81 | if (error) { 82 | console.log(error); 83 | process.exit(); 84 | } else { 85 | cb(); 86 | console.log(' ' + chalk.green(files.length) + ' files download and extracted successfully;)'); 87 | } 88 | }); 89 | }; 90 | 91 | var done = this.async(); 92 | 93 | /* -- Load in our API JSON configs */ 94 | 95 | this.answers = {}; 96 | this.askInstall = true; 97 | 98 | var installPath = this.sourceRoot() + INSTALLS_DIR; 99 | fs.readdirSync(installPath).forEach(function(file, index) { 100 | var curPath = installPath + "/" + file; 101 | if (!fs.statSync(curPath).isDirectory()) { 102 | var ext = file.substr(file.lastIndexOf('.') + 1); 103 | if (ext == 'json') { 104 | var data = fs.readFileSync(curPath); 105 | var obj = JSON.parse(data); 106 | /* -- Fill in the QUESTIONS with the found install JSON file */ 107 | installs[obj.INSTALL_KEY] = obj; 108 | INSTALL_QUESTIONS[0].choices.push({key: obj.INSTALL_KEY, name: obj.INSTALL_NAME, value: obj.INSTALL_KEY}); 109 | } 110 | } 111 | }); 112 | 113 | /* -- Ask them which install they want */ 114 | 115 | if (this.askInstall) { 116 | this._optionOrPrompt(INSTALL_QUESTIONS, function(answers) { 117 | this.install = installs[answers.installList]; 118 | /* -- Change the templates root based on the install choses */ 119 | this.sourceRoot(this.sourceRoot() + "/" + this.install.INSTALL_KEY); 120 | done(); 121 | }.bind(this)); 122 | } 123 | }, 124 | 125 | /* -- prompting -- Where you prompt users for options (where you'd call this.prompt()) */ 126 | 127 | prompting: function() { 128 | console.log(chalk.yellow.bold('[ Prompting ]')); 129 | 130 | var done = this.async(); 131 | 132 | /* -- Ask them the name they want for this app */ 133 | 134 | this.prompt(this.install.QUESTIONS, function(answers) { 135 | this.answers = answers; 136 | var installDirPath = path.dirname(path.normalize(this.destinationPath('package.json'))); 137 | this.answers.installDir = installDirPath.match(/([^\/]*)\/*$/)[1]; 138 | this.answers.templatesDir = 'templates/' + this.install.INSTALL_KEY; 139 | done(); 140 | }.bind(this)); 141 | }, 142 | 143 | /* -- configuring -- Saving configurations and configure the project (creating .editorconfig files and other metadata files) */ 144 | 145 | configuring: function() { 146 | console.log(chalk.yellow.bold('[ Configuring ]')); 147 | console.log(this.answers); 148 | 149 | /* -- Create the destination folder */ 150 | 151 | var dir = this.answers.appName; 152 | this.log('+ Creating Craft install folder ' + chalk.green(dir)); 153 | if (!fs.existsSync(dir)){ 154 | fs.mkdirSync(dir); 155 | } 156 | this.destinationRoot(this.destinationRoot() + "/" + dir); 157 | 158 | /* -- Download files */ 159 | 160 | console.log(chalk.green('> Downloading files')); 161 | var done = this.async(); 162 | var _this = this; 163 | this.synchronousLoop(this.install.DOWNLOAD_FILES, 164 | function(element, i, callback){ 165 | console.log('+ ' + chalk.green(element.name) + ' downloading'); 166 | var progress = new pleasant(); 167 | progress.start('Working'); 168 | _this.download(element.url, function() { 169 | progress.stop(); 170 | callback(); 171 | }); 172 | }, 173 | function(){ 174 | done(); 175 | }); 176 | 177 | }, 178 | 179 | /* -- writing -- Where you write the generator specific files (routes, controllers, etc) */ 180 | 181 | writing: function() { 182 | console.log(chalk.yellow.bold('[ Writing ]')); 183 | 184 | /* -- Delete the templates directory */ 185 | 186 | var deleteFolderRecursive = function(path) { 187 | if (fs.existsSync(path)) { 188 | fs.readdirSync(path).forEach(function(file, index) { 189 | var curPath = path + "/" + file; 190 | if (fs.statSync(curPath).isDirectory()) { 191 | deleteFolderRecursive(curPath); 192 | } else { 193 | fs.unlinkSync(curPath); 194 | } 195 | }); 196 | fs.rmdirSync(path); 197 | } 198 | }; 199 | 200 | /* -- Delete files */ 201 | 202 | console.log(chalk.green('> Deleting files')); 203 | for (var i = 0; i < this.install.DELETE_FILES.length; i++) { 204 | var file = this.install.DELETE_FILES[i]; 205 | if (fs.existsSync(file.src) ) { 206 | if (fs.statSync(file.src).isDirectory()) { 207 | console.log('+ Directory ' + chalk.green(file.src) + " deleted"); 208 | deleteFolderRecursive(file.src); 209 | } else { 210 | console.log('+ File ' + chalk.green(file.src) + " deleted"); 211 | fs.unlinkSync(file.src); 212 | } 213 | } 214 | } 215 | 216 | /* -- Move files */ 217 | 218 | console.log(chalk.green('> Moving files')); 219 | for (var i = 0; i < this.install.MOVE_FILES.length; i++) { 220 | var file = this.install.MOVE_FILES[i]; 221 | console.log('+ ' + file.src + ' moved to ' + chalk.green(file.dest)); 222 | fs.renameSync(file.src, 223 | file.dest 224 | ); 225 | } 226 | 227 | /* -- Write template files */ 228 | 229 | console.log(chalk.green('> Writing template files')); 230 | for (var i = 0; i < this.install.TEMPLATE_FILES.length; i++) { 231 | var file = this.install.TEMPLATE_FILES[i]; 232 | console.log('+ ' + this.answers.templatesDir + "/" + file.src + ' wrote to ' + chalk.green(file.dest)); 233 | this.fs.copyTpl( 234 | this.templatePath(file.src), 235 | this.destinationPath(file.dest), 236 | this.answers 237 | ); 238 | } 239 | 240 | /* -- Copy boilerplate files */ 241 | 242 | console.log(chalk.green('> Copying boilerplate files')); 243 | for (var i = 0; i < this.install.BOILERPLATE_FILES.length; i++) { 244 | var file = this.install.BOILERPLATE_FILES[i]; 245 | console.log('+ ' + this.answers.templatesDir + "/" + file.src + ' copied to ' + chalk.green(file.dest)); 246 | this.fs.copy( 247 | this.templatePath(file.src), 248 | this.destinationPath(file.dest) 249 | ); 250 | } 251 | 252 | /* -- Copy boilerplate directories */ 253 | 254 | console.log(chalk.green('> Copying boilerplate directories')); 255 | for (var i = 0; i < this.install.BOILERPLATE_DIRECTORIES.length; i++) { 256 | var dir = this.install.BOILERPLATE_DIRECTORIES[i]; 257 | console.log('+ ' + this.answers.templatesDir + "/" + dir.src + ' copied to ' + chalk.green(dir.dest)); 258 | ncp(this.templatePath(dir.src), this.destinationPath(dir.dest), function (err) { 259 | if (err) { 260 | return console.error(err); 261 | } 262 | }); 263 | } 264 | 265 | /* -- mysql db restore */ 266 | 267 | console.log(chalk.green('> Mysql database restore')); 268 | for (var i = 0; i < this.install.MYSQL_DBS.length; i++) { 269 | var command = "mysqldump -u " + this.install.MYSQL_DBS[i]['user'] 270 | + " -p" 271 | + this.install.MYSQL_DBS[i]['password'] 272 | + " " 273 | + this.answers.appName 274 | + " < " 275 | + this.templatePath(this.install.MYSQL_DBS[i]['src']); 276 | console.log('+ ' + chalk.green(command) + ' executed'); 277 | child_process.execSync(command); 278 | } 279 | 280 | /* -- Craft base plugins */ 281 | 282 | console.log(chalk.green('> Cloning base Craft plugins')); 283 | for (var i = 0; i < this.install.CRAFT_PLUGINS.length; i++) { 284 | var plugin = this.install.CRAFT_PLUGINS[i]; 285 | console.log('+ ' + chalk.green(plugin.name) + ' plugin installed'); 286 | child_process.execSync('git clone ' + plugin.url + ' ' + plugin.path); 287 | } 288 | 289 | console.log(chalk.green('> Sync to file system')); 290 | }, 291 | 292 | /* -- install -- Where installation are run (npm, bower) */ 293 | 294 | install: function() { 295 | console.log(chalk.yellow.bold('[ Install ]')); 296 | 297 | /* -- Set permissions on the entire Craft install tree */ 298 | 299 | console.log(chalk.green('> Setting global permissions to 755 / 644')); 300 | child_process.execSync('chmod -R 755 *'); 301 | child_process.execSync('find . -type f -exec chmod 644 {} \\;'); 302 | console.log(chalk.green('> Setting permissions on craft/app to 775 / 644')); 303 | child_process.execSync('chmod -R 775 craft/app'); 304 | child_process.execSync('find craft/app/ -type f -exec chmod 664 {} \\;'); 305 | console.log(chalk.green('> Setting permissions on craft/config to 775 / 644')); 306 | child_process.execSync('chmod -R 775 craft/config'); 307 | child_process.execSync('find craft/config/ -type f -exec chmod 664 {} \\;'); 308 | console.log(chalk.green('> Setting permissions on craft/storage to 775 / 644')); 309 | child_process.execSync('chmod -R 775 craft/storage'); 310 | child_process.execSync('find craft/storage/ -type f -exec chmod 664 {} \\;'); 311 | 312 | /* -- Create a bare remote git repository */ 313 | 314 | if (this.install.REMOTE_GIT_ORIGIN) { 315 | console.log(chalk.green('> Creating bare remote git repository')); 316 | child_process.execSync("ssh " + this.install.REMOTE_GIT_ORIGIN + " 'git init --bare " + this.answers['appName'] + ".git'"); 317 | 318 | /* -- Initialize the local git directory, add all of the files, commit them, and push them to origin master */ 319 | 320 | console.log(chalk.green('> Initializing local git repository')); 321 | child_process.execSync('git init'); 322 | child_process.execSync('git remote add origin ' + this.install.REMOTE_GIT_ORIGIN + ':' + this.answers['appName'] + '.git'); 323 | for (var i = 0; i < this.install.CRAFT_PLUGINS.length; i++) { 324 | var plugin = this.install.CRAFT_PLUGINS[i]; 325 | console.log('+ ' + chalk.green(plugin.name) + ' added as submodule'); 326 | child_process.execSync('git submodule add -f ' + plugin.url + ' ' + plugin.path); 327 | } 328 | console.log(chalk.green('> Adding project files to git repository')); 329 | child_process.execSync('git add -A'); 330 | child_process.execSync('git add -f craft/storage/.gitignore'); 331 | console.log(chalk.green('> Doing initial commit to git repository')); 332 | child_process.execSync('git commit -m "initial commit"'); 333 | console.log(chalk.green('> Pushing git repository to origin master')); 334 | child_process.execSync('git push origin master'); 335 | } 336 | 337 | /* -- Install Bower modules */ 338 | 339 | if (fs.existsSync('bower.json')) { 340 | console.log(chalk.green('> Bower Install')); 341 | this.bowerInstall(this.install.BOWER_OPTIONS); 342 | } 343 | 344 | /* -- Install NPM modules */ 345 | 346 | if (fs.existsSync('package.json')) { 347 | console.log(chalk.green('> NPM Install')); 348 | this.npmInstall(this.install.NPM_OPTIONS); 349 | } 350 | }, 351 | 352 | /* -- end - Called last, cleanup, say good bye, etc */ 353 | 354 | end: function() { 355 | console.log(chalk.yellow.bold('[ End ]')); 356 | 357 | /* -- End install commands */ 358 | 359 | console.log(chalk.green('> End install commands')); 360 | for (var i = 0; i < this.install.END_INSTALL_COMMANDS.length; i++) { 361 | var command = this.install.END_INSTALL_COMMANDS[i]; 362 | console.log('+ ' + chalk.green(command.name) + ' executed'); 363 | child_process.execSync(command.command); 364 | } 365 | 366 | console.log(chalk.green('> All set. Have a nice day.')); 367 | }, 368 | 369 | }); 370 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![No Maintenance Intended](http://unmaintained.tech/badge.svg)](http://unmaintained.tech/) 2 | 3 | # DEPRECATED 4 | 5 | This package is no longer supported, but it is fully functional, and you may continue to use it as you see fit. The license also allows you to fork it and make changes as needed for legacy support reasons. 6 | 7 | # generator-craftinstall 8 | 9 | generator-craftinstall is a [Yeoman](http://yeoman.io) generator for [Craft CMS](http://www.buildwithcraft.com) installs 10 | 11 | Type just `yo craftinstall` and a new Craft CMS project install tailored to your liking will be created. 12 | 13 | generator-craftinstall is useful right out of the box, but it intended to be a framework upon which you can build your own install configuration that creates your ideal Craft CMS scaffolding. 14 | 15 | ## Installation 16 | 17 | This assumes you have `nodejs`, `npm`, and `yeoman` installed already. 18 | 19 | 1. Download & unzip the file and place the `generator-craftinstall` directory onto your dev machine 20 | 2. -OR- do a `git clone https://github.com/nystudio107/generator-craftinstall.git` directly onto your dev machine. You can then update it with `git pull` 21 | 3. On the command line, from the root of the generator-craftinstall project (in the `generator-craftinstall/` folder), type: `npm link` to install the project dependencies and symlink a global module. On some setups, you may have to do `sudo npm link --no-bin-links` 22 | 4. -OR- do an `npm -g install generator-craftinstall` to install it via npm (and thus skip the `npm link` step) 23 | 5. The generator folder should be named `generator-craftinstall`. GitHub recently started appending `-master` (the branch name) to the name of the folder for zip file downloads. 24 | 25 | Requires Node version 4.0.0 or later. 26 | 27 | ## Usage 28 | 29 | To create a new project and use generator-craftinstall to scaffold it: 30 | 31 | yo craftinstall 32 | 33 | generator-craftinstall will prompt you to choose from a list of `installs` that define various Craft CMS environments. You can use the two that are included by default, but the real power comes when you create your own (see below). 34 | 35 | **NOTE: Craft is subject to licensing. This generator assumes you have read the terms of the Craft License Agreement, which are available [here](http://buildwithcraft.com/license)** 36 | 37 | generator-craftinstall will do the following for you: 38 | 39 | 1. Ask you which `install` to use for this Craft CMS install; `installs` are a combination of settings and files used to scaffold your Craft CMS install 40 | 2. Ask you for the name of your application (`appName`) 41 | 3. Download the lastest Craft CMS 42 | 4. Delete the default `craft/templates`, `craft/config/db.php`, and `craft/config/general.php` 43 | 5. Move the `public/htaccess` file to `public/.htaccess` so that Apache will read it 44 | 6. Create new `craft/config/db.php` and `craft/config/general.php` files with your `appName` filled in, and a multi-environment config for development & production. The database user & db name are both set to `appName` 45 | 7. Create new `bower.json` and `package.json` files with your `appName` filled in, for use with Bower and NPM 46 | 8. Copy over `.csslintrc`, `.gitignore`, and `.jshintrc` files into your project 47 | 9. Copy over any folders of boilerplate files you want (base Craft CMS templates, base CSS, scripts, whatever) 48 | 10. [Optionally] pipe a MySQL database dump into your newly installed database 49 | 11. Clone Craft CMS plugins that you use with your projects from Github 50 | 12. Set the permissions properly for your Craft CMS install; you might need to `chgrp -R WEBSERVER_GROUP` on the project folder, depending on your setup 51 | 13. [Optionally] create a bare remote `git` repository on your git server, create a local git repository, commit all of the files in your new local project to it, and push them to `origin master` 52 | 14. Run `bower install` and `npm install` on your project, so it's ready to go 53 | 15. Execute arbitrary shell commands when the install is finished 54 | 55 | ## Customizing generator-craftinstall 56 | 57 | generator-craftinstall is pretty useful out of the box, but the real bliss comes from tailoring it to your environment. To do this, look in the `app/templates` and you'll see two example `installs`: 58 | 59 | * **advanced_craft_install.json** - an "advanced" install that does things like download plugins, set up a `package.json` file for NPM, set up a `bower.json` file for Bower, etc. 60 | * **basic_craft_install.json** - just downloads Craft, and does a little cleanup for you, removing the default templates, and setting up a nice multi-environment config 61 | 62 | Open up either one of them, and you will see a number of configurable sections where you can tell generator-craftinstall how to scaffold your projects. There is a corresponding folder that contains the template files (referred to hereinafter as `templates` folder), and the `.json` file that refers to it. 63 | 64 | The easiest thing to do is make a copy of one of the prefab configs, and modify it to your liking. The nice thing about this type of configuration is you can zip up your `.json` file and your templates folder, and other people can use your `yo craftinstall` setup too. 65 | 66 | ### Basic Settings 67 | 68 | * **INSTALL_NAME** - The human readable name of the install, and what is shown in the install selector when you run `yo craftinstall` 69 | * **INSTALL_KEY** - The name of the folder in the `app/templates` directory that contains your various template and settings files. This can be named whatever you want, but it's nice to have it match the name of your `.json` file. 70 | 71 | ### QUESTIONS 72 | 73 | These are the questions that are asked prior to installation. The variables set here are passed into your TEMPLATE_FILES in the form of `<%= name %>` for substitution in your templates, e.g.: 74 | 75 | "name": "<%= appName %>", 76 | 77 | An additional variable `installDir` is also passed in automatically, e.g.: 78 | 79 | 'basePath' => '/htdocs/<%= installDir %>/', 80 | 81 | * `name:` the internal variable name (used for substitution) 82 | * `message:` the human-readable message asked during prompting 83 | * `default:` the default answer 84 | 85 | By default, generator-craftinstall just asks for the `appName` but you can add whatever additional template variables you find useful. [Inquirer.js](https://github.com/SBoudrias/Inquirer.js/) is used to ask the questions, so you can use any of the available Prompt Types that Inquirer.js supports. 86 | 87 | ### DOWNLOAD_FILES 88 | 89 | A list of arbitrary file URLs to download and extract 90 | 91 | * `name:` The human-readable name of the download file 92 | * `url:` the url to the file to be downloaded and extracted 93 | 94 | By default, generator-craftinstall just downloads the latest Craft CMS, but if you have other things you want downloaded, you can add them here. 95 | 96 | ### DELETE_FILES 97 | 98 | Files or directories that should be deleted after the download 99 | 100 | * `src:` the source path for the file, relative to the project directory 101 | 102 | By default, generator-craftinstall deletes the default `craft/templates`, `craft/config/db.php`, and `craft/config/general.php` but if you have other things you want deleted, you can add them here. 103 | 104 | ### MOVE_FILES 105 | 106 | Files that should be moved (renamed) after the download 107 | 108 | * `src:` the source path of the file, relative to the project directory 109 | * `dest:` the destination path of the file, relative to the project directory 110 | 111 | By default, generator-craftinstall just moves the `public/htaccess` file to `public/.htaccess`, but you can add any other files that you want moved/renamed here. 112 | 113 | ### TEMPLATE_FILES 114 | 115 | Files that are parsed as templates with the 'answers' context, to allow for variable substitution while copying them from `src:` to `dest:` 116 | 117 | * `src:` the source path for the file, relative to the 'templates' directory 118 | * `dest:` the destination path for the file, relative to the project directory 119 | 120 | Yeoman uses [EJS](http://ejs.co) for the templating language, so you can use any expressions that EJS supports in your templates. 121 | 122 | By default, generator-craftinstall just creates new `craft/config/db.php`, `craft/config/general.php`, `bower.json` and `package.json` files with your `appName` filled in, but you can add any additional files you want parsed as templates here. 123 | 124 | ### BOILERPLATE_FILES 125 | 126 | Individual files that we copy wholesale from 'templates' to the destination; we do it this way so we can optionally rename the files on copy 127 | 128 | * `src:` the source path of the file, relative to the 'templates' directory 129 | * `dest:` the destination path of the file, relative to the project directory 130 | 131 | By default, generator-craftinstall just copies over `.csslintrc`, `.gitignore`, and `.jshintrc` into the root of your project, but you can add any additional files you want copied here. 132 | 133 | ### BOILERPLATE_DIRECTORIES 134 | 135 | Directories that we copy wholesale from 'templates' to the destination 136 | 137 | * `src:` the source path of the directory, relative to the 'templates' directory 138 | * `dest:` the destination path of the directory, relative to the project directory 139 | 140 | By default, generator-craftinstall just copies over some dummy `craft/templates` to show you how you can do it for your own base Craft CMS templates. 141 | 142 | ### MYSQL_DBS 143 | 144 | A MySQL database dump that we pipe into your new Craft CMS install's database. Here's an example: 145 | 146 | "MYSQL_DBS": [ 147 | { 148 | "user": "homestead", 149 | "password": "secret", 150 | "src": "craft/db/dump.sql" 151 | } 152 | ], 153 | 154 | 155 | * `user:` the user name to use to connect to MySQL 156 | * `password:` the password to use to connect to MySQL 157 | * `src:` the path to the `mysqldump` for your database 158 | 159 | You can set up a default Craft install, add whatever users/fields/sections/whatever that you used as a base, then dump the database by choosing **Settings->Backup Database**. Then when you run `yo craftinstall` the database will be there waiting for you. 160 | 161 | 162 | By default, generator-craftinstall does not dump a database. 163 | 164 | ### CRAFT_PLUGINS 165 | 166 | Craft CMS plugins downloaded from git repositories on github.com 167 | 168 | * `name:` The human-readable name of the plugin 169 | * `url:` the git clone URL for the plugin 170 | * `path:` the destination path, relative to the project directory 171 | 172 | By default, generator-craftinstall just clones my `Minify`, `Cookies`, and `Path Tools` plugins, but you can change these, or add any plugins you want cloned here. 173 | 174 | ### REMOTE_GIT_ORIGIN 175 | 176 | This is the remote git server you use, in the form of user@domain.com If you don't use a git server, you can just leave this as an empty string, e.g.: `''`, to skip the git-related steps. See: [How To Set Up a Private Git Server on a VPS](https://www.digitalocean.com/community/tutorials/how-to-set-up-a-private-git-server-on-a-vps) 177 | 178 | If this is set to a `user@domain.com`, the following steps happen: 179 | 180 | 1. `ssh` to your `REMOTE_GIT_ORIGIN` and execute a `git init --bare` for your `appName` 181 | 2. Locally, `git init` && `git remote add origin`, then it add all of your `CRAFT_PLUGINS` as submodules (see below) 182 | 3. Locally, `git add -A` && `git commit -m "initial commit"` && `git push origin master` 183 | 184 | Because your `CRAFT_PLUGINS` are added as submodules, when you want to `git clone` your repo, you should do: `git clone --recursive` to have it also clone the submodules. 185 | 186 | If you want to update the submodules in your repo, do `git submodule foreach git pull origin master` and it'll update all of your submodules for you. 187 | 188 | ### END_INSTALL_COMMANDS 189 | 190 | A list of arbitrary shell commands to execute in sequence at the [ End ] phase of the generator 191 | 192 | * `name:` The human-readable name of the command 193 | * `command:` the shell command to be executed 194 | 195 | By default, generator-craftinstall doesn't execute any commands at the [ End ] phase, but you can add any that you'd like executed here. 196 | 197 | ### Sample Output 198 | 199 | Here's an example of the output from a `yo craftinstall` generator: 200 | 201 | ``` 202 | vagrant@homestead:~/sites/testapp101$ yo craftinstall 203 | [ Initializing ] 204 | ? Select which install to use: (Use arrow keys) 205 | ❯ Advanced Craft Install 206 | Basic Craft Install 207 | [ Prompting ] 208 | ? Application name testapp 209 | [ Configuring ] 210 | { appName: 'testapp', 211 | installDir: 'test', 212 | templatesDir: 'templates/advanced_craft_install' } 213 | + Creating Craft install folder testapp 214 | > Downloading files 215 | + Craft CMS downloading 216 | 4385 files download and extracted successfully;) 217 | [ Writing ] 218 | > Deleting files 219 | + Directory craft/templates deleted 220 | + File craft/config/db.php deleted 221 | + File craft/config/general.php deleted 222 | > Moving files 223 | + public/htaccess moved to public/.htaccess 224 | > Writing template files 225 | + templates/_bower.json wrote to bower.json 226 | + templates/_package.json wrote to package.json 227 | + templates/craft/config/_db.php wrote to craft/config/db.php 228 | + templates/craft/config/_general.php wrote to craft/config/general.php 229 | + templates/scripts/_pull-db-from-prod.sh wrote to scripts/pull-db-from-prod.sh 230 | + templates/scripts/_push-dev-to-git.sh wrote to scripts/push-dev-to-git.sh 231 | + templates/scripts/_push-dev-to-prod.sh wrote to scripts/push-dev-to-prod.sh 232 | > Copying boilerplate files 233 | + templates/_csslintrc copied to .csslintrc 234 | + templates/_gitignore copied to .gitignore 235 | + templates/_jshintrc copied to .jshintrc 236 | + templates/_Gruntfile.js copied to Gruntfile.js 237 | > Copying boilerplate directories 238 | + templates/craft/templates copied to craft/templates 239 | + templates/css_src copied to css_src 240 | + templates/js_src copied to js_src 241 | + templates/json_src copied to json_src 242 | + templates/img_src copied to img_src 243 | + templates/fontello_src copied to fontello_src 244 | > Copying boilerplate directories 245 | + templates/advanced_craft_install/craft/templates copied to craft/templates 246 | > Mysql database restore 247 | > Cloning base Craft plugins 248 | + Minify plugin installed 249 | Cloning into 'craft/plugins/minify'... 250 | + Cookies plugin installed 251 | Cloning into 'craft/plugins/cookies'... 252 | + Path Tools plugin installed 253 | Cloning into 'craft/plugins/pathtools'... 254 | > Sync to file system 255 | create bower.json 256 | create package.json 257 | create craft/config/db.php 258 | create craft/config/general.php 259 | create scripts/pull-db-from-prod.sh 260 | create scripts/push-dev-to-git.sh 261 | create scripts/push-dev-to-prod.sh 262 | create .csslintrc 263 | create .gitignore 264 | create .jshintrc 265 | create Gruntfile.js 266 | [ Install ] 267 | > Creating craft/storage directory 268 | > Setting global permissions to 755 269 | > Setting permissions on craft/app/ to 775 270 | > Setting permissions on craft/config/ to 775 271 | > Setting permissions on craft/storage to 775 272 | > Creating bare remote git repository 273 | > Initializing local git repository 274 | + Minify added as submodule 275 | + Cookies added as submodule 276 | + Path Tools added as submodule 277 | > Adding project files to git repository 278 | > Doing initial commit to git repository 279 | > Pushing git repository to origin master 280 | To git@tastystakes.com:testapp.git 281 | * [new branch] master -> master 282 | > Bower Install 283 | > NPM Install 284 | [ End ] 285 | > End install commands 286 | + animate.css npm install executed 287 | > All set. Have a nice day. 288 | vagrant@homestead:~/sites/testapp101$ 289 | ``` 290 | 291 | ## Debugging 292 | 293 | If you receive an error that looks like this when doing `yo craftinstall`: 294 | 295 | ``` 296 | [ Initializing ] 297 | events.js:141 298 | throw er; // Unhandled 'error' event 299 | ^ 300 | 301 | SyntaxError: Unexpected token ] 302 | at Object.parse (native) 303 | at /home/vagrant/webdev/craft/public/generator-craftinstall/app/index.js:86:36 304 | at Array.forEach (native) 305 | at module.exports.yo.generators.Base.extend.initializing (/home/vagrant/webdev/craft/public/generator-craftinstall/app/index.js:80:37) 306 | at /home/vagrant/webdev/craft/public/generator-craftinstall/node_modules/yeoman-generator/lib/base.js:429:16 307 | at processImmediate [as _immediateCallback] (timers.js:371:17) 308 | ``` 309 | 310 | ...this means there is an error in your JSON file. Validate your JSON with [jsonlint.com](http://jsonlint.com) 311 | 312 | ## Changelog 313 | 314 | ### 1.1.3 -- 2016.05.05 315 | 316 | * [Fixed] Rewrote the download system to be synchronous 317 | * [Improved] Updated README.md 318 | 319 | ### 1.1.2 -- 2016.05.05 320 | 321 | * [Fixed] Fixed an issue with multiple files being downloaded in `DOWNLOAD_FILES` thanks to @wbrowar 322 | * [Improved] Updated README.md 323 | 324 | ### 1.1.1 -- 2016.05.02 325 | 326 | * [Improved] Cleaned up the documentation a good bit 327 | * [Fixed] Removed the MYSQL_DBS from the `advanced_craft_install.json` 328 | * [Improved] Updated README.md 329 | 330 | ### 1.1.0 -- 2016.05.02 331 | 332 | * [Added] Added the ability to create as many install configs as you like 333 | * [Added] Renamed it `generator-craftinstall` (was: generator-nystudio107) 334 | * [Improved] Updated README.md 335 | 336 | ### 1.0.0 -- 2015.11.29 337 | 338 | * [Added] Initial release 339 | -------------------------------------------------------------------------------- /app/templates/advanced_craft_install/craft/db/dump.sql: -------------------------------------------------------------------------------- 1 | -- Generated by Craft v2.6.2783 on May 2, 2016, 3:41:36 AM. 2 | 3 | -- 4 | -- Disable foreign key checks and autocommit. 5 | -- 6 | 7 | SET FOREIGN_KEY_CHECKS = 0; 8 | SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; 9 | SET AUTOCOMMIT = 0; 10 | SET NAMES utf8; 11 | 12 | 13 | DROP TABLE IF EXISTS `craft_assetfiles`; 14 | 15 | 16 | -- 17 | -- Schema for table `craft_assetfiles` 18 | -- 19 | CREATE TABLE `craft_assetfiles` ( 20 | `id` int(11) NOT NULL, 21 | `sourceId` int(11) DEFAULT NULL, 22 | `folderId` int(11) NOT NULL, 23 | `filename` varchar(255) COLLATE utf8_unicode_ci NOT NULL, 24 | `kind` varchar(50) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'unknown', 25 | `width` int(11) unsigned DEFAULT NULL, 26 | `height` int(11) unsigned DEFAULT NULL, 27 | `size` bigint(20) unsigned DEFAULT NULL, 28 | `dateModified` datetime DEFAULT NULL, 29 | `dateCreated` datetime NOT NULL, 30 | `dateUpdated` datetime NOT NULL, 31 | `uid` char(36) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', 32 | PRIMARY KEY (`id`), 33 | UNIQUE KEY `craft_assetfiles_filename_folderId_unq_idx` (`filename`,`folderId`), 34 | KEY `craft_assetfiles_sourceId_fk` (`sourceId`), 35 | KEY `craft_assetfiles_folderId_fk` (`folderId`) 36 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 37 | 38 | DROP TABLE IF EXISTS `craft_assetfolders`; 39 | 40 | 41 | -- 42 | -- Schema for table `craft_assetfolders` 43 | -- 44 | CREATE TABLE `craft_assetfolders` ( 45 | `id` int(11) NOT NULL AUTO_INCREMENT, 46 | `parentId` int(11) DEFAULT NULL, 47 | `sourceId` int(11) DEFAULT NULL, 48 | `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, 49 | `path` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, 50 | `dateCreated` datetime NOT NULL, 51 | `dateUpdated` datetime NOT NULL, 52 | `uid` char(36) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', 53 | PRIMARY KEY (`id`), 54 | UNIQUE KEY `craft_assetfolders_name_parentId_sourceId_unq_idx` (`name`,`parentId`,`sourceId`), 55 | KEY `craft_assetfolders_parentId_fk` (`parentId`), 56 | KEY `craft_assetfolders_sourceId_fk` (`sourceId`) 57 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 58 | 59 | DROP TABLE IF EXISTS `craft_assetindexdata`; 60 | 61 | 62 | -- 63 | -- Schema for table `craft_assetindexdata` 64 | -- 65 | CREATE TABLE `craft_assetindexdata` ( 66 | `id` int(11) NOT NULL AUTO_INCREMENT, 67 | `sessionId` varchar(36) COLLATE utf8_unicode_ci NOT NULL DEFAULT '', 68 | `sourceId` int(10) NOT NULL, 69 | `offset` int(10) NOT NULL, 70 | `uri` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, 71 | `size` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, 72 | `recordId` int(10) DEFAULT NULL, 73 | `dateCreated` datetime NOT NULL, 74 | `dateUpdated` datetime NOT NULL, 75 | `uid` char(36) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', 76 | PRIMARY KEY (`id`), 77 | UNIQUE KEY `craft_assetindexdata_sessionId_sourceId_offset_unq_idx` (`sessionId`,`sourceId`,`offset`), 78 | KEY `craft_assetindexdata_sourceId_fk` (`sourceId`) 79 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 80 | 81 | DROP TABLE IF EXISTS `craft_assetsources`; 82 | 83 | 84 | -- 85 | -- Schema for table `craft_assetsources` 86 | -- 87 | CREATE TABLE `craft_assetsources` ( 88 | `id` int(11) NOT NULL AUTO_INCREMENT, 89 | `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, 90 | `handle` varchar(255) COLLATE utf8_unicode_ci NOT NULL, 91 | `type` varchar(150) COLLATE utf8_unicode_ci NOT NULL, 92 | `settings` text COLLATE utf8_unicode_ci, 93 | `sortOrder` smallint(6) unsigned DEFAULT NULL, 94 | `fieldLayoutId` int(10) DEFAULT NULL, 95 | `dateCreated` datetime NOT NULL, 96 | `dateUpdated` datetime NOT NULL, 97 | `uid` char(36) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', 98 | PRIMARY KEY (`id`), 99 | UNIQUE KEY `craft_assetsources_name_unq_idx` (`name`), 100 | UNIQUE KEY `craft_assetsources_handle_unq_idx` (`handle`), 101 | KEY `craft_assetsources_fieldLayoutId_fk` (`fieldLayoutId`) 102 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 103 | 104 | DROP TABLE IF EXISTS `craft_assettransformindex`; 105 | 106 | 107 | -- 108 | -- Schema for table `craft_assettransformindex` 109 | -- 110 | CREATE TABLE `craft_assettransformindex` ( 111 | `id` int(11) NOT NULL AUTO_INCREMENT, 112 | `fileId` int(11) NOT NULL, 113 | `filename` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, 114 | `format` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, 115 | `location` varchar(255) COLLATE utf8_unicode_ci NOT NULL, 116 | `sourceId` int(11) DEFAULT NULL, 117 | `fileExists` tinyint(1) DEFAULT NULL, 118 | `inProgress` tinyint(1) DEFAULT NULL, 119 | `dateIndexed` datetime DEFAULT NULL, 120 | `dateCreated` datetime NOT NULL, 121 | `dateUpdated` datetime NOT NULL, 122 | `uid` char(36) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', 123 | PRIMARY KEY (`id`), 124 | KEY `craft_assettransformindex_sourceId_fileId_location_idx` (`sourceId`,`fileId`,`location`) 125 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 126 | 127 | DROP TABLE IF EXISTS `craft_assettransforms`; 128 | 129 | 130 | -- 131 | -- Schema for table `craft_assettransforms` 132 | -- 133 | CREATE TABLE `craft_assettransforms` ( 134 | `id` int(11) NOT NULL AUTO_INCREMENT, 135 | `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, 136 | `handle` varchar(255) COLLATE utf8_unicode_ci NOT NULL, 137 | `mode` enum('stretch','fit','crop') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'crop', 138 | `position` enum('top-left','top-center','top-right','center-left','center-center','center-right','bottom-left','bottom-center','bottom-right') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'center-center', 139 | `height` int(10) DEFAULT NULL, 140 | `width` int(10) DEFAULT NULL, 141 | `format` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, 142 | `quality` int(10) DEFAULT NULL, 143 | `dimensionChangeTime` datetime DEFAULT NULL, 144 | `dateCreated` datetime NOT NULL, 145 | `dateUpdated` datetime NOT NULL, 146 | `uid` char(36) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', 147 | PRIMARY KEY (`id`), 148 | UNIQUE KEY `craft_assettransforms_name_unq_idx` (`name`), 149 | UNIQUE KEY `craft_assettransforms_handle_unq_idx` (`handle`) 150 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 151 | 152 | DROP TABLE IF EXISTS `craft_categories`; 153 | 154 | 155 | -- 156 | -- Schema for table `craft_categories` 157 | -- 158 | CREATE TABLE `craft_categories` ( 159 | `id` int(11) NOT NULL, 160 | `groupId` int(11) NOT NULL, 161 | `dateCreated` datetime NOT NULL, 162 | `dateUpdated` datetime NOT NULL, 163 | `uid` char(36) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', 164 | PRIMARY KEY (`id`), 165 | KEY `craft_categories_groupId_fk` (`groupId`) 166 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 167 | 168 | DROP TABLE IF EXISTS `craft_categorygroups`; 169 | 170 | 171 | -- 172 | -- Schema for table `craft_categorygroups` 173 | -- 174 | CREATE TABLE `craft_categorygroups` ( 175 | `id` int(11) NOT NULL AUTO_INCREMENT, 176 | `structureId` int(11) NOT NULL, 177 | `fieldLayoutId` int(11) DEFAULT NULL, 178 | `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, 179 | `handle` varchar(255) COLLATE utf8_unicode_ci NOT NULL, 180 | `hasUrls` tinyint(1) unsigned NOT NULL DEFAULT '1', 181 | `template` varchar(500) COLLATE utf8_unicode_ci DEFAULT NULL, 182 | `dateCreated` datetime NOT NULL, 183 | `dateUpdated` datetime NOT NULL, 184 | `uid` char(36) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', 185 | PRIMARY KEY (`id`), 186 | UNIQUE KEY `craft_categorygroups_name_unq_idx` (`name`), 187 | UNIQUE KEY `craft_categorygroups_handle_unq_idx` (`handle`), 188 | KEY `craft_categorygroups_structureId_fk` (`structureId`), 189 | KEY `craft_categorygroups_fieldLayoutId_fk` (`fieldLayoutId`) 190 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 191 | 192 | DROP TABLE IF EXISTS `craft_categorygroups_i18n`; 193 | 194 | 195 | -- 196 | -- Schema for table `craft_categorygroups_i18n` 197 | -- 198 | CREATE TABLE `craft_categorygroups_i18n` ( 199 | `id` int(11) NOT NULL AUTO_INCREMENT, 200 | `groupId` int(11) NOT NULL, 201 | `locale` char(12) COLLATE utf8_unicode_ci NOT NULL, 202 | `urlFormat` text COLLATE utf8_unicode_ci, 203 | `nestedUrlFormat` text COLLATE utf8_unicode_ci, 204 | `dateCreated` datetime NOT NULL, 205 | `dateUpdated` datetime NOT NULL, 206 | `uid` char(36) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', 207 | PRIMARY KEY (`id`), 208 | UNIQUE KEY `craft_categorygroups_i18n_groupId_locale_unq_idx` (`groupId`,`locale`), 209 | KEY `craft_categorygroups_i18n_locale_fk` (`locale`) 210 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 211 | 212 | DROP TABLE IF EXISTS `craft_content`; 213 | 214 | 215 | -- 216 | -- Schema for table `craft_content` 217 | -- 218 | CREATE TABLE `craft_content` ( 219 | `id` int(11) NOT NULL AUTO_INCREMENT, 220 | `elementId` int(11) NOT NULL, 221 | `locale` char(12) COLLATE utf8_unicode_ci NOT NULL, 222 | `title` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, 223 | `dateCreated` datetime NOT NULL, 224 | `dateUpdated` datetime NOT NULL, 225 | `uid` char(36) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', 226 | PRIMARY KEY (`id`), 227 | UNIQUE KEY `craft_content_elementId_locale_unq_idx` (`elementId`,`locale`), 228 | KEY `craft_content_title_idx` (`title`), 229 | KEY `craft_content_locale_fk` (`locale`) 230 | ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 231 | 232 | -- 233 | -- Data for table `craft_content` 234 | -- 235 | 236 | INSERT INTO `craft_content` (`id`, `elementId`, `locale`, `title`, `dateCreated`, `dateUpdated`, `uid`) VALUES 237 | ('1', '1', 'en_us', NULL, '2016-05-02 03:39:11', '2016-05-02 03:39:11', '0f43d90f-5ee3-48ca-a7dd-9bf710653ca7'); 238 | 239 | 240 | 241 | DROP TABLE IF EXISTS `craft_deprecationerrors`; 242 | 243 | 244 | -- 245 | -- Schema for table `craft_deprecationerrors` 246 | -- 247 | CREATE TABLE `craft_deprecationerrors` ( 248 | `id` int(11) NOT NULL AUTO_INCREMENT, 249 | `key` varchar(255) COLLATE utf8_unicode_ci NOT NULL, 250 | `fingerprint` varchar(255) COLLATE utf8_unicode_ci NOT NULL, 251 | `lastOccurrence` datetime NOT NULL, 252 | `file` varchar(255) COLLATE utf8_unicode_ci NOT NULL, 253 | `line` smallint(6) unsigned NOT NULL, 254 | `class` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, 255 | `method` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, 256 | `template` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, 257 | `templateLine` smallint(6) unsigned DEFAULT NULL, 258 | `message` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, 259 | `traces` text COLLATE utf8_unicode_ci, 260 | `dateCreated` datetime NOT NULL, 261 | `dateUpdated` datetime NOT NULL, 262 | `uid` char(36) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', 263 | PRIMARY KEY (`id`), 264 | UNIQUE KEY `craft_deprecationerrors_key_fingerprint_unq_idx` (`key`,`fingerprint`) 265 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 266 | 267 | DROP TABLE IF EXISTS `craft_elementindexsettings`; 268 | 269 | 270 | -- 271 | -- Schema for table `craft_elementindexsettings` 272 | -- 273 | CREATE TABLE `craft_elementindexsettings` ( 274 | `id` int(11) NOT NULL AUTO_INCREMENT, 275 | `type` varchar(150) COLLATE utf8_unicode_ci NOT NULL, 276 | `settings` text COLLATE utf8_unicode_ci, 277 | `dateCreated` datetime NOT NULL, 278 | `dateUpdated` datetime NOT NULL, 279 | `uid` char(36) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', 280 | PRIMARY KEY (`id`), 281 | UNIQUE KEY `craft_elementindexsettings_type_unq_idx` (`type`) 282 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 283 | 284 | DROP TABLE IF EXISTS `craft_elements`; 285 | 286 | 287 | -- 288 | -- Schema for table `craft_elements` 289 | -- 290 | CREATE TABLE `craft_elements` ( 291 | `id` int(11) NOT NULL AUTO_INCREMENT, 292 | `type` varchar(150) COLLATE utf8_unicode_ci NOT NULL, 293 | `enabled` tinyint(1) unsigned NOT NULL DEFAULT '1', 294 | `archived` tinyint(1) unsigned NOT NULL DEFAULT '0', 295 | `dateCreated` datetime NOT NULL, 296 | `dateUpdated` datetime NOT NULL, 297 | `uid` char(36) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', 298 | PRIMARY KEY (`id`), 299 | KEY `craft_elements_type_idx` (`type`), 300 | KEY `craft_elements_enabled_idx` (`enabled`), 301 | KEY `craft_elements_archived_dateCreated_idx` (`archived`,`dateCreated`) 302 | ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 303 | 304 | -- 305 | -- Data for table `craft_elements` 306 | -- 307 | 308 | INSERT INTO `craft_elements` (`id`, `type`, `enabled`, `archived`, `dateCreated`, `dateUpdated`, `uid`) VALUES 309 | ('1', 'User', '1', '0', '2016-05-02 03:39:11', '2016-05-02 03:39:11', '5eeb79e2-5809-4c5f-ac23-267e6b1cef97'); 310 | 311 | 312 | 313 | DROP TABLE IF EXISTS `craft_elements_i18n`; 314 | 315 | 316 | -- 317 | -- Schema for table `craft_elements_i18n` 318 | -- 319 | CREATE TABLE `craft_elements_i18n` ( 320 | `id` int(11) NOT NULL AUTO_INCREMENT, 321 | `elementId` int(11) NOT NULL, 322 | `locale` char(12) COLLATE utf8_unicode_ci NOT NULL, 323 | `slug` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, 324 | `uri` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, 325 | `enabled` tinyint(1) unsigned NOT NULL DEFAULT '1', 326 | `dateCreated` datetime NOT NULL, 327 | `dateUpdated` datetime NOT NULL, 328 | `uid` char(36) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', 329 | PRIMARY KEY (`id`), 330 | UNIQUE KEY `craft_elements_i18n_elementId_locale_unq_idx` (`elementId`,`locale`), 331 | UNIQUE KEY `craft_elements_i18n_uri_locale_unq_idx` (`uri`,`locale`), 332 | KEY `craft_elements_i18n_slug_locale_idx` (`slug`,`locale`), 333 | KEY `craft_elements_i18n_enabled_idx` (`enabled`), 334 | KEY `craft_elements_i18n_locale_fk` (`locale`) 335 | ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 336 | 337 | -- 338 | -- Data for table `craft_elements_i18n` 339 | -- 340 | 341 | INSERT INTO `craft_elements_i18n` (`id`, `elementId`, `locale`, `slug`, `uri`, `enabled`, `dateCreated`, `dateUpdated`, `uid`) VALUES 342 | ('1', '1', 'en_us', '', NULL, '1', '2016-05-02 03:39:11', '2016-05-02 03:39:11', 'ebf2dda5-8f23-48fb-aa33-fa7fc1909106'); 343 | 344 | 345 | 346 | DROP TABLE IF EXISTS `craft_emailmessages`; 347 | 348 | 349 | -- 350 | -- Schema for table `craft_emailmessages` 351 | -- 352 | CREATE TABLE `craft_emailmessages` ( 353 | `id` int(11) NOT NULL AUTO_INCREMENT, 354 | `key` char(150) COLLATE utf8_unicode_ci NOT NULL, 355 | `locale` char(12) COLLATE utf8_unicode_ci NOT NULL, 356 | `subject` varchar(1000) COLLATE utf8_unicode_ci NOT NULL, 357 | `body` text COLLATE utf8_unicode_ci NOT NULL, 358 | `dateCreated` datetime NOT NULL, 359 | `dateUpdated` datetime NOT NULL, 360 | `uid` char(36) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', 361 | PRIMARY KEY (`id`), 362 | UNIQUE KEY `craft_emailmessages_key_locale_unq_idx` (`key`,`locale`), 363 | KEY `craft_emailmessages_locale_fk` (`locale`) 364 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 365 | 366 | DROP TABLE IF EXISTS `craft_entries`; 367 | 368 | 369 | -- 370 | -- Schema for table `craft_entries` 371 | -- 372 | CREATE TABLE `craft_entries` ( 373 | `id` int(11) NOT NULL, 374 | `sectionId` int(11) NOT NULL, 375 | `typeId` int(11) DEFAULT NULL, 376 | `authorId` int(11) DEFAULT NULL, 377 | `postDate` datetime DEFAULT NULL, 378 | `expiryDate` datetime DEFAULT NULL, 379 | `dateCreated` datetime NOT NULL, 380 | `dateUpdated` datetime NOT NULL, 381 | `uid` char(36) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', 382 | PRIMARY KEY (`id`), 383 | KEY `craft_entries_sectionId_idx` (`sectionId`), 384 | KEY `craft_entries_typeId_idx` (`typeId`), 385 | KEY `craft_entries_postDate_idx` (`postDate`), 386 | KEY `craft_entries_expiryDate_idx` (`expiryDate`), 387 | KEY `craft_entries_authorId_fk` (`authorId`) 388 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 389 | 390 | DROP TABLE IF EXISTS `craft_entrydrafts`; 391 | 392 | 393 | -- 394 | -- Schema for table `craft_entrydrafts` 395 | -- 396 | CREATE TABLE `craft_entrydrafts` ( 397 | `id` int(11) NOT NULL AUTO_INCREMENT, 398 | `entryId` int(11) NOT NULL, 399 | `sectionId` int(11) NOT NULL, 400 | `creatorId` int(11) NOT NULL, 401 | `locale` char(12) COLLATE utf8_unicode_ci NOT NULL, 402 | `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, 403 | `notes` tinytext COLLATE utf8_unicode_ci, 404 | `data` mediumtext COLLATE utf8_unicode_ci NOT NULL, 405 | `dateCreated` datetime NOT NULL, 406 | `dateUpdated` datetime NOT NULL, 407 | `uid` char(36) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', 408 | PRIMARY KEY (`id`), 409 | KEY `craft_entrydrafts_entryId_locale_idx` (`entryId`,`locale`), 410 | KEY `craft_entrydrafts_sectionId_fk` (`sectionId`), 411 | KEY `craft_entrydrafts_creatorId_fk` (`creatorId`), 412 | KEY `craft_entrydrafts_locale_fk` (`locale`) 413 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 414 | 415 | DROP TABLE IF EXISTS `craft_entrytypes`; 416 | 417 | 418 | -- 419 | -- Schema for table `craft_entrytypes` 420 | -- 421 | CREATE TABLE `craft_entrytypes` ( 422 | `id` int(11) NOT NULL AUTO_INCREMENT, 423 | `sectionId` int(11) NOT NULL, 424 | `fieldLayoutId` int(11) DEFAULT NULL, 425 | `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, 426 | `handle` varchar(255) COLLATE utf8_unicode_ci NOT NULL, 427 | `hasTitleField` tinyint(1) unsigned NOT NULL DEFAULT '1', 428 | `titleLabel` varchar(255) COLLATE utf8_unicode_ci DEFAULT 'Title', 429 | `titleFormat` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, 430 | `sortOrder` smallint(6) unsigned DEFAULT NULL, 431 | `dateCreated` datetime NOT NULL, 432 | `dateUpdated` datetime NOT NULL, 433 | `uid` char(36) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', 434 | PRIMARY KEY (`id`), 435 | UNIQUE KEY `craft_entrytypes_name_sectionId_unq_idx` (`name`,`sectionId`), 436 | UNIQUE KEY `craft_entrytypes_handle_sectionId_unq_idx` (`handle`,`sectionId`), 437 | KEY `craft_entrytypes_sectionId_fk` (`sectionId`), 438 | KEY `craft_entrytypes_fieldLayoutId_fk` (`fieldLayoutId`) 439 | ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 440 | 441 | DROP TABLE IF EXISTS `craft_entryversions`; 442 | 443 | 444 | -- 445 | -- Schema for table `craft_entryversions` 446 | -- 447 | CREATE TABLE `craft_entryversions` ( 448 | `id` int(11) NOT NULL AUTO_INCREMENT, 449 | `entryId` int(11) NOT NULL, 450 | `sectionId` int(11) NOT NULL, 451 | `creatorId` int(11) DEFAULT NULL, 452 | `locale` char(12) COLLATE utf8_unicode_ci NOT NULL, 453 | `num` smallint(6) unsigned NOT NULL, 454 | `notes` tinytext COLLATE utf8_unicode_ci, 455 | `data` mediumtext COLLATE utf8_unicode_ci NOT NULL, 456 | `dateCreated` datetime NOT NULL, 457 | `dateUpdated` datetime NOT NULL, 458 | `uid` char(36) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', 459 | PRIMARY KEY (`id`), 460 | KEY `craft_entryversions_entryId_locale_idx` (`entryId`,`locale`), 461 | KEY `craft_entryversions_sectionId_fk` (`sectionId`), 462 | KEY `craft_entryversions_creatorId_fk` (`creatorId`), 463 | KEY `craft_entryversions_locale_fk` (`locale`) 464 | ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 465 | 466 | DROP TABLE IF EXISTS `craft_fieldgroups`; 467 | 468 | 469 | -- 470 | -- Schema for table `craft_fieldgroups` 471 | -- 472 | CREATE TABLE `craft_fieldgroups` ( 473 | `id` int(11) NOT NULL AUTO_INCREMENT, 474 | `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, 475 | `dateCreated` datetime NOT NULL, 476 | `dateUpdated` datetime NOT NULL, 477 | `uid` char(36) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', 478 | PRIMARY KEY (`id`), 479 | UNIQUE KEY `craft_fieldgroups_name_unq_idx` (`name`) 480 | ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 481 | 482 | -- 483 | -- Data for table `craft_fieldgroups` 484 | -- 485 | 486 | INSERT INTO `craft_fieldgroups` (`id`, `name`, `dateCreated`, `dateUpdated`, `uid`) VALUES 487 | ('1', 'Default', '2016-05-02 03:39:12', '2016-05-02 03:39:12', '4d9b9fdb-4d75-4f65-8a44-0d081cde1dcd'); 488 | 489 | 490 | 491 | DROP TABLE IF EXISTS `craft_fieldlayoutfields`; 492 | 493 | 494 | -- 495 | -- Schema for table `craft_fieldlayoutfields` 496 | -- 497 | CREATE TABLE `craft_fieldlayoutfields` ( 498 | `id` int(11) NOT NULL AUTO_INCREMENT, 499 | `layoutId` int(11) NOT NULL, 500 | `tabId` int(11) NOT NULL, 501 | `fieldId` int(11) NOT NULL, 502 | `required` tinyint(1) unsigned NOT NULL DEFAULT '0', 503 | `sortOrder` smallint(6) unsigned DEFAULT NULL, 504 | `dateCreated` datetime NOT NULL, 505 | `dateUpdated` datetime NOT NULL, 506 | `uid` char(36) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', 507 | PRIMARY KEY (`id`), 508 | UNIQUE KEY `craft_fieldlayoutfields_layoutId_fieldId_unq_idx` (`layoutId`,`fieldId`), 509 | KEY `craft_fieldlayoutfields_sortOrder_idx` (`sortOrder`), 510 | KEY `craft_fieldlayoutfields_tabId_fk` (`tabId`), 511 | KEY `craft_fieldlayoutfields_fieldId_fk` (`fieldId`) 512 | ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 513 | 514 | DROP TABLE IF EXISTS `craft_fieldlayouts`; 515 | 516 | 517 | -- 518 | -- Schema for table `craft_fieldlayouts` 519 | -- 520 | CREATE TABLE `craft_fieldlayouts` ( 521 | `id` int(11) NOT NULL AUTO_INCREMENT, 522 | `type` varchar(150) COLLATE utf8_unicode_ci NOT NULL, 523 | `dateCreated` datetime NOT NULL, 524 | `dateUpdated` datetime NOT NULL, 525 | `uid` char(36) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', 526 | PRIMARY KEY (`id`), 527 | KEY `craft_fieldlayouts_type_idx` (`type`) 528 | ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 529 | 530 | -- 531 | -- Data for table `craft_fieldlayouts` 532 | -- 533 | 534 | INSERT INTO `craft_fieldlayouts` (`id`, `type`, `dateCreated`, `dateUpdated`, `uid`) VALUES 535 | ('1', 'Tag', '2016-05-02 03:39:12', '2016-05-02 03:39:12', 'fdecfd28-7950-4327-993e-3c1fb57840c9'), 536 | ('3', 'Entry', '2016-05-02 03:39:12', '2016-05-02 03:39:12', 'c4211bf4-0230-4ccb-ac09-3bcab1398c9c'), 537 | ('5', 'Entry', '2016-05-02 03:39:12', '2016-05-02 03:39:12', '3e5c9284-faa4-4f64-a76e-06727dcec8d4'); 538 | 539 | 540 | 541 | DROP TABLE IF EXISTS `craft_fieldlayouttabs`; 542 | 543 | 544 | -- 545 | -- Schema for table `craft_fieldlayouttabs` 546 | -- 547 | CREATE TABLE `craft_fieldlayouttabs` ( 548 | `id` int(11) NOT NULL AUTO_INCREMENT, 549 | `layoutId` int(11) NOT NULL, 550 | `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, 551 | `sortOrder` smallint(6) unsigned DEFAULT NULL, 552 | `dateCreated` datetime NOT NULL, 553 | `dateUpdated` datetime NOT NULL, 554 | `uid` char(36) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', 555 | PRIMARY KEY (`id`), 556 | KEY `craft_fieldlayouttabs_sortOrder_idx` (`sortOrder`), 557 | KEY `craft_fieldlayouttabs_layoutId_fk` (`layoutId`) 558 | ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 559 | 560 | -- 561 | -- Data for table `craft_fieldlayouttabs` 562 | -- 563 | 564 | INSERT INTO `craft_fieldlayouttabs` (`id`, `layoutId`, `name`, `sortOrder`, `dateCreated`, `dateUpdated`, `uid`) VALUES 565 | ('1', '3', 'Content', '1', '2016-05-02 03:39:12', '2016-05-02 03:39:12', '116eb501-5806-4e2e-8b2f-2414459f8800'), 566 | ('2', '5', 'Content', '1', '2016-05-02 03:39:12', '2016-05-02 03:39:12', 'f948b7d4-bc28-4c3b-98c0-b6d34181fac9'); 567 | 568 | 569 | 570 | DROP TABLE IF EXISTS `craft_fields`; 571 | 572 | 573 | -- 574 | -- Schema for table `craft_fields` 575 | -- 576 | CREATE TABLE `craft_fields` ( 577 | `id` int(11) NOT NULL AUTO_INCREMENT, 578 | `groupId` int(11) DEFAULT NULL, 579 | `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, 580 | `handle` varchar(58) COLLATE utf8_unicode_ci NOT NULL, 581 | `context` varchar(255) COLLATE utf8_unicode_ci NOT NULL DEFAULT 'global', 582 | `instructions` text COLLATE utf8_unicode_ci, 583 | `translatable` tinyint(1) unsigned NOT NULL DEFAULT '0', 584 | `type` varchar(150) COLLATE utf8_unicode_ci NOT NULL, 585 | `settings` text COLLATE utf8_unicode_ci, 586 | `dateCreated` datetime NOT NULL, 587 | `dateUpdated` datetime NOT NULL, 588 | `uid` char(36) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', 589 | PRIMARY KEY (`id`), 590 | UNIQUE KEY `craft_fields_handle_context_unq_idx` (`handle`,`context`), 591 | KEY `craft_fields_context_idx` (`context`), 592 | KEY `craft_fields_groupId_fk` (`groupId`) 593 | ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 594 | 595 | DROP TABLE IF EXISTS `craft_globalsets`; 596 | 597 | 598 | -- 599 | -- Schema for table `craft_globalsets` 600 | -- 601 | CREATE TABLE `craft_globalsets` ( 602 | `id` int(11) NOT NULL, 603 | `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, 604 | `handle` varchar(255) COLLATE utf8_unicode_ci NOT NULL, 605 | `fieldLayoutId` int(10) DEFAULT NULL, 606 | `dateCreated` datetime NOT NULL, 607 | `dateUpdated` datetime NOT NULL, 608 | `uid` char(36) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', 609 | PRIMARY KEY (`id`), 610 | UNIQUE KEY `craft_globalsets_name_unq_idx` (`name`), 611 | UNIQUE KEY `craft_globalsets_handle_unq_idx` (`handle`), 612 | KEY `craft_globalsets_fieldLayoutId_fk` (`fieldLayoutId`) 613 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 614 | 615 | DROP TABLE IF EXISTS `craft_info`; 616 | 617 | 618 | -- 619 | -- Schema for table `craft_info` 620 | -- 621 | CREATE TABLE `craft_info` ( 622 | `id` int(11) NOT NULL AUTO_INCREMENT, 623 | `version` varchar(15) COLLATE utf8_unicode_ci NOT NULL, 624 | `build` int(11) unsigned NOT NULL, 625 | `schemaVersion` varchar(15) COLLATE utf8_unicode_ci NOT NULL, 626 | `releaseDate` datetime NOT NULL, 627 | `edition` tinyint(1) unsigned NOT NULL DEFAULT '0', 628 | `siteName` varchar(100) COLLATE utf8_unicode_ci NOT NULL, 629 | `siteUrl` varchar(255) COLLATE utf8_unicode_ci NOT NULL, 630 | `timezone` varchar(30) COLLATE utf8_unicode_ci DEFAULT NULL, 631 | `on` tinyint(1) unsigned NOT NULL DEFAULT '0', 632 | `maintenance` tinyint(1) unsigned NOT NULL DEFAULT '0', 633 | `track` varchar(40) COLLATE utf8_unicode_ci NOT NULL, 634 | `dateCreated` datetime NOT NULL, 635 | `dateUpdated` datetime NOT NULL, 636 | `uid` char(36) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', 637 | PRIMARY KEY (`id`) 638 | ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 639 | 640 | -- 641 | -- Data for table `craft_info` 642 | -- 643 | 644 | INSERT INTO `craft_info` (`id`, `version`, `build`, `schemaVersion`, `releaseDate`, `edition`, `siteName`, `siteUrl`, `timezone`, `on`, `maintenance`, `track`, `dateCreated`, `dateUpdated`, `uid`) VALUES 645 | ('1', '2.6', '2783', '2.6.3', '2016-04-29 20:33:32', '0', 'ChangeMe', 'http://ChangeMe.dev', 'UTC', '1', '0', 'stable', '2016-05-02 03:39:10', '2016-05-02 03:41:06', '95a41a9c-c4aa-4198-aef3-2b9753cb0707'); 646 | 647 | 648 | 649 | DROP TABLE IF EXISTS `craft_locales`; 650 | 651 | 652 | -- 653 | -- Schema for table `craft_locales` 654 | -- 655 | CREATE TABLE `craft_locales` ( 656 | `locale` char(12) COLLATE utf8_unicode_ci NOT NULL, 657 | `sortOrder` smallint(6) unsigned DEFAULT NULL, 658 | `dateCreated` datetime NOT NULL, 659 | `dateUpdated` datetime NOT NULL, 660 | `uid` char(36) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', 661 | PRIMARY KEY (`locale`), 662 | KEY `craft_locales_sortOrder_idx` (`sortOrder`) 663 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 664 | 665 | -- 666 | -- Data for table `craft_locales` 667 | -- 668 | 669 | INSERT INTO `craft_locales` (`locale`, `sortOrder`, `dateCreated`, `dateUpdated`, `uid`) VALUES 670 | ('en_us', '1', '2016-05-02 03:39:10', '2016-05-02 03:39:10', 'b64d85d7-8a58-4d66-b9c8-54b51dd0bd1e'); 671 | 672 | 673 | 674 | DROP TABLE IF EXISTS `craft_matrixblocks`; 675 | 676 | 677 | -- 678 | -- Schema for table `craft_matrixblocks` 679 | -- 680 | CREATE TABLE `craft_matrixblocks` ( 681 | `id` int(11) NOT NULL, 682 | `ownerId` int(11) NOT NULL, 683 | `fieldId` int(11) NOT NULL, 684 | `typeId` int(11) DEFAULT NULL, 685 | `sortOrder` smallint(6) unsigned DEFAULT NULL, 686 | `ownerLocale` char(12) COLLATE utf8_unicode_ci DEFAULT NULL, 687 | `dateCreated` datetime NOT NULL, 688 | `dateUpdated` datetime NOT NULL, 689 | `uid` char(36) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', 690 | PRIMARY KEY (`id`), 691 | KEY `craft_matrixblocks_ownerId_idx` (`ownerId`), 692 | KEY `craft_matrixblocks_fieldId_idx` (`fieldId`), 693 | KEY `craft_matrixblocks_typeId_idx` (`typeId`), 694 | KEY `craft_matrixblocks_sortOrder_idx` (`sortOrder`), 695 | KEY `craft_matrixblocks_ownerLocale_fk` (`ownerLocale`) 696 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 697 | 698 | DROP TABLE IF EXISTS `craft_matrixblocktypes`; 699 | 700 | 701 | -- 702 | -- Schema for table `craft_matrixblocktypes` 703 | -- 704 | CREATE TABLE `craft_matrixblocktypes` ( 705 | `id` int(11) NOT NULL AUTO_INCREMENT, 706 | `fieldId` int(11) NOT NULL, 707 | `fieldLayoutId` int(11) DEFAULT NULL, 708 | `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, 709 | `handle` varchar(255) COLLATE utf8_unicode_ci NOT NULL, 710 | `sortOrder` smallint(6) unsigned DEFAULT NULL, 711 | `dateCreated` datetime NOT NULL, 712 | `dateUpdated` datetime NOT NULL, 713 | `uid` char(36) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', 714 | PRIMARY KEY (`id`), 715 | UNIQUE KEY `craft_matrixblocktypes_name_fieldId_unq_idx` (`name`,`fieldId`), 716 | UNIQUE KEY `craft_matrixblocktypes_handle_fieldId_unq_idx` (`handle`,`fieldId`), 717 | KEY `craft_matrixblocktypes_fieldId_fk` (`fieldId`), 718 | KEY `craft_matrixblocktypes_fieldLayoutId_fk` (`fieldLayoutId`) 719 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 720 | 721 | DROP TABLE IF EXISTS `craft_migrations`; 722 | 723 | 724 | -- 725 | -- Schema for table `craft_migrations` 726 | -- 727 | CREATE TABLE `craft_migrations` ( 728 | `id` int(11) NOT NULL AUTO_INCREMENT, 729 | `pluginId` int(11) DEFAULT NULL, 730 | `version` varchar(255) COLLATE utf8_unicode_ci NOT NULL, 731 | `applyTime` datetime NOT NULL, 732 | `dateCreated` datetime NOT NULL, 733 | `dateUpdated` datetime NOT NULL, 734 | `uid` char(36) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', 735 | PRIMARY KEY (`id`), 736 | UNIQUE KEY `craft_migrations_version_unq_idx` (`version`), 737 | KEY `craft_migrations_pluginId_fk` (`pluginId`) 738 | ) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 739 | 740 | -- 741 | -- Data for table `craft_migrations` 742 | -- 743 | 744 | INSERT INTO `craft_migrations` (`id`, `pluginId`, `version`, `applyTime`, `dateCreated`, `dateUpdated`, `uid`) VALUES 745 | ('1', NULL, 'm000000_000000_base', '2016-05-02 03:39:10', '2016-05-02 03:39:10', '2016-05-02 03:39:10', '98da2b6e-7088-4557-b5e9-16468f70f1bf'), 746 | ('2', NULL, 'm140730_000001_add_filename_and_format_to_transformindex', '2016-05-02 03:39:10', '2016-05-02 03:39:10', '2016-05-02 03:39:10', 'd4a2bdf5-3239-41d9-aad0-26b00c754ff5'), 747 | ('3', NULL, 'm140815_000001_add_format_to_transforms', '2016-05-02 03:39:10', '2016-05-02 03:39:10', '2016-05-02 03:39:10', '09d2edd8-0079-423e-8f3d-899edb55f898'), 748 | ('4', NULL, 'm140822_000001_allow_more_than_128_items_per_field', '2016-05-02 03:39:10', '2016-05-02 03:39:10', '2016-05-02 03:39:10', '71316a60-b647-4ddb-abf0-a05633fd1253'), 749 | ('5', NULL, 'm140829_000001_single_title_formats', '2016-05-02 03:39:10', '2016-05-02 03:39:10', '2016-05-02 03:39:10', 'e11541ba-d176-41ce-b45b-2895e75d73c8'), 750 | ('6', NULL, 'm140831_000001_extended_cache_keys', '2016-05-02 03:39:10', '2016-05-02 03:39:10', '2016-05-02 03:39:10', 'edb796c1-28ae-4470-85a2-d0e625e3c75b'), 751 | ('7', NULL, 'm140922_000001_delete_orphaned_matrix_blocks', '2016-05-02 03:39:10', '2016-05-02 03:39:10', '2016-05-02 03:39:10', '1865b8a0-f066-4820-9123-9ddab6523d04'), 752 | ('8', NULL, 'm141008_000001_elements_index_tune', '2016-05-02 03:39:10', '2016-05-02 03:39:10', '2016-05-02 03:39:10', 'bdee4c48-dc5a-4cf1-ae20-bde14eb91050'), 753 | ('9', NULL, 'm141009_000001_assets_source_handle', '2016-05-02 03:39:10', '2016-05-02 03:39:10', '2016-05-02 03:39:10', 'a3140062-65ba-4302-bb20-d0084faf8d19'), 754 | ('10', NULL, 'm141024_000001_field_layout_tabs', '2016-05-02 03:39:10', '2016-05-02 03:39:10', '2016-05-02 03:39:10', '188d5622-d0ac-45a1-9c39-0754b2309026'), 755 | ('11', NULL, 'm141030_000000_plugin_schema_versions', '2016-05-02 03:39:10', '2016-05-02 03:39:10', '2016-05-02 03:39:10', '8edf929b-dd00-4c55-b007-9d2e6b9b4d8e'), 756 | ('12', NULL, 'm141030_000001_drop_structure_move_permission', '2016-05-02 03:39:10', '2016-05-02 03:39:10', '2016-05-02 03:39:10', '546d2e4a-a61a-44b9-ac4e-9d0da8502450'), 757 | ('13', NULL, 'm141103_000001_tag_titles', '2016-05-02 03:39:10', '2016-05-02 03:39:10', '2016-05-02 03:39:10', 'c85f61cb-9ad4-4cb6-af7e-1206467c892f'), 758 | ('14', NULL, 'm141109_000001_user_status_shuffle', '2016-05-02 03:39:10', '2016-05-02 03:39:10', '2016-05-02 03:39:10', '9ea9a707-05b2-43ff-9080-bca843dbdad8'), 759 | ('15', NULL, 'm141126_000001_user_week_start_day', '2016-05-02 03:39:10', '2016-05-02 03:39:10', '2016-05-02 03:39:10', '1eacc198-e3f0-446f-9aec-94dcde137fa2'), 760 | ('16', NULL, 'm150210_000001_adjust_user_photo_size', '2016-05-02 03:39:10', '2016-05-02 03:39:10', '2016-05-02 03:39:10', '2f8f0186-1449-423a-a259-e8d0cdf8e405'), 761 | ('17', NULL, 'm150724_000001_adjust_quality_settings', '2016-05-02 03:39:10', '2016-05-02 03:39:10', '2016-05-02 03:39:10', '6d0dadb2-660c-4369-8155-44166772d843'), 762 | ('18', NULL, 'm150827_000000_element_index_settings', '2016-05-02 03:39:10', '2016-05-02 03:39:10', '2016-05-02 03:39:10', '471db545-edb2-4f20-a525-bf254935b1af'), 763 | ('19', NULL, 'm150918_000001_add_colspan_to_widgets', '2016-05-02 03:39:10', '2016-05-02 03:39:10', '2016-05-02 03:39:10', '3794af48-5ea6-46fe-810a-eea93cc5972f'), 764 | ('20', NULL, 'm151007_000000_clear_asset_caches', '2016-05-02 03:39:10', '2016-05-02 03:39:10', '2016-05-02 03:39:10', 'c504edd1-450d-4692-959d-8acc1004c71a'), 765 | ('21', NULL, 'm151109_000000_text_url_formats', '2016-05-02 03:39:10', '2016-05-02 03:39:10', '2016-05-02 03:39:10', '1b86810a-75ab-4dd6-8184-35ae0bf5af5f'), 766 | ('22', NULL, 'm151110_000000_move_logo', '2016-05-02 03:39:10', '2016-05-02 03:39:10', '2016-05-02 03:39:10', 'fa13d81d-a52f-4543-bf8f-2db6b82ff664'), 767 | ('23', NULL, 'm151117_000000_adjust_image_widthheight', '2016-05-02 03:39:10', '2016-05-02 03:39:10', '2016-05-02 03:39:10', '275c7516-a851-4916-ac62-0665635a6928'), 768 | ('24', NULL, 'm151127_000000_clear_license_key_status', '2016-05-02 03:39:10', '2016-05-02 03:39:10', '2016-05-02 03:39:10', '7fd29219-f69e-4e46-9370-772d276c8038'), 769 | ('25', NULL, 'm151127_000000_plugin_license_keys', '2016-05-02 03:39:10', '2016-05-02 03:39:10', '2016-05-02 03:39:10', '980eb011-d28f-439f-9690-213964deadf0'), 770 | ('26', NULL, 'm151130_000000_update_pt_widget_feeds', '2016-05-02 03:39:10', '2016-05-02 03:39:10', '2016-05-02 03:39:10', '3bbac848-e28b-4455-8751-08f09890956d'), 771 | ('27', NULL, 'm160114_000000_asset_sources_public_url_default_true', '2016-05-02 03:39:10', '2016-05-02 03:39:10', '2016-05-02 03:39:10', 'cc9b9ce5-8d4a-4f9a-a636-a3e2ed7dcc38'), 772 | ('28', NULL, 'm160223_000000_sortorder_to_smallint', '2016-05-02 03:39:10', '2016-05-02 03:39:10', '2016-05-02 03:39:10', 'cabf7c19-2261-42ad-adf4-d24baeb3c64d'), 773 | ('29', NULL, 'm160229_000000_set_default_entry_statuses', '2016-05-02 03:39:10', '2016-05-02 03:39:10', '2016-05-02 03:39:10', 'c7ed82f2-e62f-42c5-af02-53b4edf08edf'), 774 | ('30', NULL, 'm160304_000000_client_permissions', '2016-05-02 03:39:10', '2016-05-02 03:39:10', '2016-05-02 03:39:10', '2f98b1ac-ea9f-4e8a-a2e1-128b241bf025'), 775 | ('31', NULL, 'm160322_000000_asset_filesize', '2016-05-02 03:39:10', '2016-05-02 03:39:10', '2016-05-02 03:39:10', 'e48fe304-0baa-4ed0-86f5-5a7f34570f2f'); 776 | 777 | 778 | 779 | DROP TABLE IF EXISTS `craft_plugins`; 780 | 781 | 782 | -- 783 | -- Schema for table `craft_plugins` 784 | -- 785 | CREATE TABLE `craft_plugins` ( 786 | `id` int(11) NOT NULL AUTO_INCREMENT, 787 | `class` varchar(150) COLLATE utf8_unicode_ci NOT NULL, 788 | `version` varchar(15) COLLATE utf8_unicode_ci NOT NULL, 789 | `schemaVersion` varchar(15) COLLATE utf8_unicode_ci DEFAULT NULL, 790 | `licenseKey` char(24) COLLATE utf8_unicode_ci DEFAULT NULL, 791 | `licenseKeyStatus` enum('valid','invalid','mismatched','unknown') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'unknown', 792 | `enabled` tinyint(1) unsigned NOT NULL DEFAULT '0', 793 | `settings` text COLLATE utf8_unicode_ci, 794 | `installDate` datetime NOT NULL, 795 | `dateCreated` datetime NOT NULL, 796 | `dateUpdated` datetime NOT NULL, 797 | `uid` char(36) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', 798 | PRIMARY KEY (`id`) 799 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 800 | 801 | DROP TABLE IF EXISTS `craft_rackspaceaccess`; 802 | 803 | 804 | -- 805 | -- Schema for table `craft_rackspaceaccess` 806 | -- 807 | CREATE TABLE `craft_rackspaceaccess` ( 808 | `id` int(11) NOT NULL AUTO_INCREMENT, 809 | `connectionKey` varchar(255) COLLATE utf8_unicode_ci NOT NULL, 810 | `token` varchar(255) COLLATE utf8_unicode_ci NOT NULL, 811 | `storageUrl` varchar(255) COLLATE utf8_unicode_ci NOT NULL, 812 | `cdnUrl` varchar(255) COLLATE utf8_unicode_ci NOT NULL, 813 | `dateCreated` datetime NOT NULL, 814 | `dateUpdated` datetime NOT NULL, 815 | `uid` char(36) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', 816 | PRIMARY KEY (`id`), 817 | UNIQUE KEY `craft_rackspaceaccess_connectionKey_unq_idx` (`connectionKey`) 818 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 819 | 820 | DROP TABLE IF EXISTS `craft_relations`; 821 | 822 | 823 | -- 824 | -- Schema for table `craft_relations` 825 | -- 826 | CREATE TABLE `craft_relations` ( 827 | `id` int(11) NOT NULL AUTO_INCREMENT, 828 | `fieldId` int(11) NOT NULL, 829 | `sourceId` int(11) NOT NULL, 830 | `sourceLocale` char(12) COLLATE utf8_unicode_ci DEFAULT NULL, 831 | `targetId` int(11) NOT NULL, 832 | `sortOrder` smallint(6) DEFAULT NULL, 833 | `dateCreated` datetime NOT NULL, 834 | `dateUpdated` datetime NOT NULL, 835 | `uid` char(36) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', 836 | PRIMARY KEY (`id`), 837 | UNIQUE KEY `craft_relations_fieldId_sourceId_sourceLocale_targetId_unq_idx` (`fieldId`,`sourceId`,`sourceLocale`,`targetId`), 838 | KEY `craft_relations_sourceId_fk` (`sourceId`), 839 | KEY `craft_relations_sourceLocale_fk` (`sourceLocale`), 840 | KEY `craft_relations_targetId_fk` (`targetId`) 841 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 842 | 843 | DROP TABLE IF EXISTS `craft_routes`; 844 | 845 | 846 | -- 847 | -- Schema for table `craft_routes` 848 | -- 849 | CREATE TABLE `craft_routes` ( 850 | `id` int(11) NOT NULL AUTO_INCREMENT, 851 | `locale` char(12) COLLATE utf8_unicode_ci DEFAULT NULL, 852 | `urlParts` varchar(255) COLLATE utf8_unicode_ci NOT NULL, 853 | `urlPattern` varchar(255) COLLATE utf8_unicode_ci NOT NULL, 854 | `template` varchar(255) COLLATE utf8_unicode_ci NOT NULL, 855 | `sortOrder` smallint(6) unsigned DEFAULT NULL, 856 | `dateCreated` datetime NOT NULL, 857 | `dateUpdated` datetime NOT NULL, 858 | `uid` char(36) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', 859 | PRIMARY KEY (`id`), 860 | UNIQUE KEY `craft_routes_urlPattern_unq_idx` (`urlPattern`), 861 | KEY `craft_routes_locale_idx` (`locale`) 862 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 863 | 864 | DROP TABLE IF EXISTS `craft_searchindex`; 865 | 866 | 867 | -- 868 | -- Schema for table `craft_searchindex` 869 | -- 870 | CREATE TABLE `craft_searchindex` ( 871 | `elementId` int(11) NOT NULL, 872 | `attribute` varchar(25) COLLATE utf8_unicode_ci NOT NULL, 873 | `fieldId` int(11) NOT NULL, 874 | `locale` char(12) COLLATE utf8_unicode_ci NOT NULL, 875 | `keywords` text COLLATE utf8_unicode_ci NOT NULL, 876 | PRIMARY KEY (`elementId`,`attribute`,`fieldId`,`locale`), 877 | FULLTEXT KEY `craft_searchindex_keywords_idx` (`keywords`) 878 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 879 | 880 | -- 881 | -- Data for table `craft_searchindex` 882 | -- 883 | 884 | INSERT INTO `craft_searchindex` (`elementId`, `attribute`, `fieldId`, `locale`, `keywords`) VALUES 885 | ('1', 'username', '0', 'en_us', ' admin admin com '), 886 | ('1', 'firstname', '0', 'en_us', ''), 887 | ('1', 'lastname', '0', 'en_us', ''), 888 | ('1', 'fullname', '0', 'en_us', ''), 889 | ('1', 'email', '0', 'en_us', ' admin admin com '), 890 | ('1', 'slug', '0', 'en_us', ''); 891 | 892 | 893 | 894 | DROP TABLE IF EXISTS `craft_sections`; 895 | 896 | 897 | -- 898 | -- Schema for table `craft_sections` 899 | -- 900 | CREATE TABLE `craft_sections` ( 901 | `id` int(11) NOT NULL AUTO_INCREMENT, 902 | `structureId` int(11) DEFAULT NULL, 903 | `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, 904 | `handle` varchar(255) COLLATE utf8_unicode_ci NOT NULL, 905 | `type` enum('single','channel','structure') COLLATE utf8_unicode_ci NOT NULL DEFAULT 'channel', 906 | `hasUrls` tinyint(1) unsigned NOT NULL DEFAULT '1', 907 | `template` varchar(500) COLLATE utf8_unicode_ci DEFAULT NULL, 908 | `enableVersioning` tinyint(1) unsigned NOT NULL DEFAULT '0', 909 | `dateCreated` datetime NOT NULL, 910 | `dateUpdated` datetime NOT NULL, 911 | `uid` char(36) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', 912 | PRIMARY KEY (`id`), 913 | UNIQUE KEY `craft_sections_name_unq_idx` (`name`), 914 | UNIQUE KEY `craft_sections_handle_unq_idx` (`handle`), 915 | KEY `craft_sections_structureId_fk` (`structureId`) 916 | ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 917 | 918 | DROP TABLE IF EXISTS `craft_sections_i18n`; 919 | 920 | 921 | -- 922 | -- Schema for table `craft_sections_i18n` 923 | -- 924 | CREATE TABLE `craft_sections_i18n` ( 925 | `id` int(11) NOT NULL AUTO_INCREMENT, 926 | `sectionId` int(11) NOT NULL, 927 | `locale` char(12) COLLATE utf8_unicode_ci NOT NULL, 928 | `enabledByDefault` tinyint(1) unsigned NOT NULL DEFAULT '1', 929 | `urlFormat` text COLLATE utf8_unicode_ci, 930 | `nestedUrlFormat` text COLLATE utf8_unicode_ci, 931 | `dateCreated` datetime NOT NULL, 932 | `dateUpdated` datetime NOT NULL, 933 | `uid` char(36) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', 934 | PRIMARY KEY (`id`), 935 | UNIQUE KEY `craft_sections_i18n_sectionId_locale_unq_idx` (`sectionId`,`locale`), 936 | KEY `craft_sections_i18n_locale_fk` (`locale`) 937 | ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 938 | 939 | DROP TABLE IF EXISTS `craft_sessions`; 940 | 941 | 942 | -- 943 | -- Schema for table `craft_sessions` 944 | -- 945 | CREATE TABLE `craft_sessions` ( 946 | `id` int(11) NOT NULL AUTO_INCREMENT, 947 | `userId` int(11) NOT NULL, 948 | `token` char(100) COLLATE utf8_unicode_ci NOT NULL, 949 | `dateCreated` datetime NOT NULL, 950 | `dateUpdated` datetime NOT NULL, 951 | `uid` char(36) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', 952 | PRIMARY KEY (`id`), 953 | KEY `craft_sessions_uid_idx` (`uid`), 954 | KEY `craft_sessions_token_idx` (`token`), 955 | KEY `craft_sessions_dateUpdated_idx` (`dateUpdated`), 956 | KEY `craft_sessions_userId_fk` (`userId`) 957 | ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 958 | 959 | DROP TABLE IF EXISTS `craft_shunnedmessages`; 960 | 961 | 962 | -- 963 | -- Schema for table `craft_shunnedmessages` 964 | -- 965 | CREATE TABLE `craft_shunnedmessages` ( 966 | `id` int(11) NOT NULL AUTO_INCREMENT, 967 | `userId` int(11) NOT NULL, 968 | `message` varchar(255) COLLATE utf8_unicode_ci NOT NULL, 969 | `expiryDate` datetime DEFAULT NULL, 970 | `dateCreated` datetime NOT NULL, 971 | `dateUpdated` datetime NOT NULL, 972 | `uid` char(36) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', 973 | PRIMARY KEY (`id`), 974 | UNIQUE KEY `craft_shunnedmessages_userId_message_unq_idx` (`userId`,`message`) 975 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 976 | 977 | DROP TABLE IF EXISTS `craft_structureelements`; 978 | 979 | 980 | -- 981 | -- Schema for table `craft_structureelements` 982 | -- 983 | CREATE TABLE `craft_structureelements` ( 984 | `id` int(11) NOT NULL AUTO_INCREMENT, 985 | `structureId` int(11) NOT NULL, 986 | `elementId` int(11) DEFAULT NULL, 987 | `root` int(11) unsigned DEFAULT NULL, 988 | `lft` int(11) unsigned NOT NULL, 989 | `rgt` int(11) unsigned NOT NULL, 990 | `level` smallint(6) unsigned NOT NULL, 991 | `dateCreated` datetime NOT NULL, 992 | `dateUpdated` datetime NOT NULL, 993 | `uid` char(36) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', 994 | PRIMARY KEY (`id`), 995 | UNIQUE KEY `craft_structureelements_structureId_elementId_unq_idx` (`structureId`,`elementId`), 996 | KEY `craft_structureelements_root_idx` (`root`), 997 | KEY `craft_structureelements_lft_idx` (`lft`), 998 | KEY `craft_structureelements_rgt_idx` (`rgt`), 999 | KEY `craft_structureelements_level_idx` (`level`), 1000 | KEY `craft_structureelements_elementId_fk` (`elementId`) 1001 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 1002 | 1003 | DROP TABLE IF EXISTS `craft_structures`; 1004 | 1005 | 1006 | -- 1007 | -- Schema for table `craft_structures` 1008 | -- 1009 | CREATE TABLE `craft_structures` ( 1010 | `id` int(11) NOT NULL AUTO_INCREMENT, 1011 | `maxLevels` smallint(6) unsigned DEFAULT NULL, 1012 | `dateCreated` datetime NOT NULL, 1013 | `dateUpdated` datetime NOT NULL, 1014 | `uid` char(36) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', 1015 | PRIMARY KEY (`id`) 1016 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 1017 | 1018 | DROP TABLE IF EXISTS `craft_systemsettings`; 1019 | 1020 | 1021 | -- 1022 | -- Schema for table `craft_systemsettings` 1023 | -- 1024 | CREATE TABLE `craft_systemsettings` ( 1025 | `id` int(11) NOT NULL AUTO_INCREMENT, 1026 | `category` varchar(15) COLLATE utf8_unicode_ci NOT NULL, 1027 | `settings` text COLLATE utf8_unicode_ci, 1028 | `dateCreated` datetime NOT NULL, 1029 | `dateUpdated` datetime NOT NULL, 1030 | `uid` char(36) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', 1031 | PRIMARY KEY (`id`), 1032 | UNIQUE KEY `craft_systemsettings_category_unq_idx` (`category`) 1033 | ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 1034 | 1035 | -- 1036 | -- Data for table `craft_systemsettings` 1037 | -- 1038 | 1039 | INSERT INTO `craft_systemsettings` (`id`, `category`, `settings`, `dateCreated`, `dateUpdated`, `uid`) VALUES 1040 | ('1', 'email', '{\"protocol\":\"php\",\"emailAddress\":\"admin@admin.com\",\"senderName\":\"Testapp\"}', '2016-05-02 03:39:12', '2016-05-02 03:39:12', '0fc152a7-bfba-4967-b46c-df23431b86a2'); 1041 | 1042 | 1043 | 1044 | DROP TABLE IF EXISTS `craft_taggroups`; 1045 | 1046 | 1047 | -- 1048 | -- Schema for table `craft_taggroups` 1049 | -- 1050 | CREATE TABLE `craft_taggroups` ( 1051 | `id` int(11) NOT NULL AUTO_INCREMENT, 1052 | `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, 1053 | `handle` varchar(255) COLLATE utf8_unicode_ci NOT NULL, 1054 | `fieldLayoutId` int(10) DEFAULT NULL, 1055 | `dateCreated` datetime NOT NULL, 1056 | `dateUpdated` datetime NOT NULL, 1057 | `uid` char(36) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', 1058 | PRIMARY KEY (`id`), 1059 | UNIQUE KEY `craft_taggroups_name_unq_idx` (`name`), 1060 | UNIQUE KEY `craft_taggroups_handle_unq_idx` (`handle`), 1061 | KEY `craft_taggroups_fieldLayoutId_fk` (`fieldLayoutId`) 1062 | ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 1063 | 1064 | -- 1065 | -- Data for table `craft_taggroups` 1066 | -- 1067 | 1068 | INSERT INTO `craft_taggroups` (`id`, `name`, `handle`, `fieldLayoutId`, `dateCreated`, `dateUpdated`, `uid`) VALUES 1069 | ('1', 'Default', 'default', '1', '2016-05-02 03:39:12', '2016-05-02 03:39:12', '5c02a2ea-d9eb-42a1-bfa0-1b72415be6ad'); 1070 | 1071 | 1072 | 1073 | DROP TABLE IF EXISTS `craft_tags`; 1074 | 1075 | 1076 | -- 1077 | -- Schema for table `craft_tags` 1078 | -- 1079 | CREATE TABLE `craft_tags` ( 1080 | `id` int(11) NOT NULL, 1081 | `groupId` int(11) NOT NULL, 1082 | `dateCreated` datetime NOT NULL, 1083 | `dateUpdated` datetime NOT NULL, 1084 | `uid` char(36) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', 1085 | PRIMARY KEY (`id`), 1086 | KEY `craft_tags_groupId_fk` (`groupId`) 1087 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 1088 | 1089 | DROP TABLE IF EXISTS `craft_tasks`; 1090 | 1091 | 1092 | -- 1093 | -- Schema for table `craft_tasks` 1094 | -- 1095 | CREATE TABLE `craft_tasks` ( 1096 | `id` int(11) NOT NULL AUTO_INCREMENT, 1097 | `root` int(11) unsigned DEFAULT NULL, 1098 | `lft` int(11) unsigned NOT NULL, 1099 | `rgt` int(11) unsigned NOT NULL, 1100 | `level` smallint(6) unsigned NOT NULL, 1101 | `currentStep` int(11) unsigned DEFAULT NULL, 1102 | `totalSteps` int(11) unsigned DEFAULT NULL, 1103 | `status` enum('pending','error','running') COLLATE utf8_unicode_ci DEFAULT NULL, 1104 | `type` varchar(150) COLLATE utf8_unicode_ci NOT NULL, 1105 | `description` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, 1106 | `settings` text COLLATE utf8_unicode_ci, 1107 | `dateCreated` datetime NOT NULL, 1108 | `dateUpdated` datetime NOT NULL, 1109 | `uid` char(36) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', 1110 | PRIMARY KEY (`id`), 1111 | KEY `craft_tasks_root_idx` (`root`), 1112 | KEY `craft_tasks_lft_idx` (`lft`), 1113 | KEY `craft_tasks_rgt_idx` (`rgt`), 1114 | KEY `craft_tasks_level_idx` (`level`) 1115 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 1116 | 1117 | DROP TABLE IF EXISTS `craft_templatecachecriteria`; 1118 | 1119 | 1120 | -- 1121 | -- Schema for table `craft_templatecachecriteria` 1122 | -- 1123 | CREATE TABLE `craft_templatecachecriteria` ( 1124 | `id` int(11) NOT NULL AUTO_INCREMENT, 1125 | `cacheId` int(11) NOT NULL, 1126 | `type` varchar(150) COLLATE utf8_unicode_ci NOT NULL, 1127 | `criteria` text COLLATE utf8_unicode_ci NOT NULL, 1128 | PRIMARY KEY (`id`), 1129 | KEY `craft_templatecachecriteria_cacheId_fk` (`cacheId`), 1130 | KEY `craft_templatecachecriteria_type_idx` (`type`) 1131 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 1132 | 1133 | DROP TABLE IF EXISTS `craft_templatecacheelements`; 1134 | 1135 | 1136 | -- 1137 | -- Schema for table `craft_templatecacheelements` 1138 | -- 1139 | CREATE TABLE `craft_templatecacheelements` ( 1140 | `cacheId` int(11) NOT NULL, 1141 | `elementId` int(11) NOT NULL, 1142 | KEY `craft_templatecacheelements_cacheId_fk` (`cacheId`), 1143 | KEY `craft_templatecacheelements_elementId_fk` (`elementId`) 1144 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 1145 | 1146 | DROP TABLE IF EXISTS `craft_templatecaches`; 1147 | 1148 | 1149 | -- 1150 | -- Schema for table `craft_templatecaches` 1151 | -- 1152 | CREATE TABLE `craft_templatecaches` ( 1153 | `id` int(11) NOT NULL AUTO_INCREMENT, 1154 | `cacheKey` varchar(255) COLLATE utf8_unicode_ci NOT NULL, 1155 | `locale` char(12) COLLATE utf8_unicode_ci NOT NULL, 1156 | `path` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, 1157 | `expiryDate` datetime NOT NULL, 1158 | `body` mediumtext COLLATE utf8_unicode_ci NOT NULL, 1159 | PRIMARY KEY (`id`), 1160 | KEY `craft_templatecaches_expiryDate_cacheKey_locale_path_idx` (`expiryDate`,`cacheKey`,`locale`,`path`), 1161 | KEY `craft_templatecaches_locale_fk` (`locale`) 1162 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 1163 | 1164 | DROP TABLE IF EXISTS `craft_tokens`; 1165 | 1166 | 1167 | -- 1168 | -- Schema for table `craft_tokens` 1169 | -- 1170 | CREATE TABLE `craft_tokens` ( 1171 | `id` int(11) NOT NULL AUTO_INCREMENT, 1172 | `token` char(32) COLLATE utf8_unicode_ci NOT NULL, 1173 | `route` text COLLATE utf8_unicode_ci, 1174 | `usageLimit` tinyint(3) unsigned DEFAULT NULL, 1175 | `usageCount` tinyint(3) unsigned DEFAULT NULL, 1176 | `expiryDate` datetime NOT NULL, 1177 | `dateCreated` datetime NOT NULL, 1178 | `dateUpdated` datetime NOT NULL, 1179 | `uid` char(36) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', 1180 | PRIMARY KEY (`id`), 1181 | UNIQUE KEY `craft_tokens_token_unq_idx` (`token`), 1182 | KEY `craft_tokens_expiryDate_idx` (`expiryDate`) 1183 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 1184 | 1185 | DROP TABLE IF EXISTS `craft_usergroups`; 1186 | 1187 | 1188 | -- 1189 | -- Schema for table `craft_usergroups` 1190 | -- 1191 | CREATE TABLE `craft_usergroups` ( 1192 | `id` int(11) NOT NULL AUTO_INCREMENT, 1193 | `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, 1194 | `handle` varchar(255) COLLATE utf8_unicode_ci NOT NULL, 1195 | `dateCreated` datetime NOT NULL, 1196 | `dateUpdated` datetime NOT NULL, 1197 | `uid` char(36) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', 1198 | PRIMARY KEY (`id`) 1199 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 1200 | 1201 | DROP TABLE IF EXISTS `craft_usergroups_users`; 1202 | 1203 | 1204 | -- 1205 | -- Schema for table `craft_usergroups_users` 1206 | -- 1207 | CREATE TABLE `craft_usergroups_users` ( 1208 | `id` int(11) NOT NULL AUTO_INCREMENT, 1209 | `groupId` int(11) NOT NULL, 1210 | `userId` int(11) NOT NULL, 1211 | `dateCreated` datetime NOT NULL, 1212 | `dateUpdated` datetime NOT NULL, 1213 | `uid` char(36) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', 1214 | PRIMARY KEY (`id`), 1215 | UNIQUE KEY `craft_usergroups_users_groupId_userId_unq_idx` (`groupId`,`userId`), 1216 | KEY `craft_usergroups_users_userId_fk` (`userId`) 1217 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 1218 | 1219 | DROP TABLE IF EXISTS `craft_userpermissions`; 1220 | 1221 | 1222 | -- 1223 | -- Schema for table `craft_userpermissions` 1224 | -- 1225 | CREATE TABLE `craft_userpermissions` ( 1226 | `id` int(11) NOT NULL AUTO_INCREMENT, 1227 | `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, 1228 | `dateCreated` datetime NOT NULL, 1229 | `dateUpdated` datetime NOT NULL, 1230 | `uid` char(36) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', 1231 | PRIMARY KEY (`id`), 1232 | UNIQUE KEY `craft_userpermissions_name_unq_idx` (`name`) 1233 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 1234 | 1235 | DROP TABLE IF EXISTS `craft_userpermissions_usergroups`; 1236 | 1237 | 1238 | -- 1239 | -- Schema for table `craft_userpermissions_usergroups` 1240 | -- 1241 | CREATE TABLE `craft_userpermissions_usergroups` ( 1242 | `id` int(11) NOT NULL AUTO_INCREMENT, 1243 | `permissionId` int(11) NOT NULL, 1244 | `groupId` int(11) NOT NULL, 1245 | `dateCreated` datetime NOT NULL, 1246 | `dateUpdated` datetime NOT NULL, 1247 | `uid` char(36) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', 1248 | PRIMARY KEY (`id`), 1249 | UNIQUE KEY `craft_userpermissions_usergroups_permissionId_groupId_unq_idx` (`permissionId`,`groupId`), 1250 | KEY `craft_userpermissions_usergroups_groupId_fk` (`groupId`) 1251 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 1252 | 1253 | DROP TABLE IF EXISTS `craft_userpermissions_users`; 1254 | 1255 | 1256 | -- 1257 | -- Schema for table `craft_userpermissions_users` 1258 | -- 1259 | CREATE TABLE `craft_userpermissions_users` ( 1260 | `id` int(11) NOT NULL AUTO_INCREMENT, 1261 | `permissionId` int(11) NOT NULL, 1262 | `userId` int(11) NOT NULL, 1263 | `dateCreated` datetime NOT NULL, 1264 | `dateUpdated` datetime NOT NULL, 1265 | `uid` char(36) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', 1266 | PRIMARY KEY (`id`), 1267 | UNIQUE KEY `craft_userpermissions_users_permissionId_userId_unq_idx` (`permissionId`,`userId`), 1268 | KEY `craft_userpermissions_users_userId_fk` (`userId`) 1269 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 1270 | 1271 | DROP TABLE IF EXISTS `craft_users`; 1272 | 1273 | 1274 | -- 1275 | -- Schema for table `craft_users` 1276 | -- 1277 | CREATE TABLE `craft_users` ( 1278 | `id` int(11) NOT NULL, 1279 | `username` varchar(100) COLLATE utf8_unicode_ci NOT NULL, 1280 | `photo` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, 1281 | `firstName` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, 1282 | `lastName` varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL, 1283 | `email` varchar(255) COLLATE utf8_unicode_ci NOT NULL, 1284 | `password` char(255) COLLATE utf8_unicode_ci DEFAULT NULL, 1285 | `preferredLocale` char(12) COLLATE utf8_unicode_ci DEFAULT NULL, 1286 | `weekStartDay` tinyint(1) unsigned NOT NULL DEFAULT '0', 1287 | `admin` tinyint(1) unsigned NOT NULL DEFAULT '0', 1288 | `client` tinyint(1) unsigned NOT NULL DEFAULT '0', 1289 | `locked` tinyint(1) unsigned NOT NULL DEFAULT '0', 1290 | `suspended` tinyint(1) unsigned NOT NULL DEFAULT '0', 1291 | `pending` tinyint(1) unsigned NOT NULL DEFAULT '0', 1292 | `archived` tinyint(1) unsigned NOT NULL DEFAULT '0', 1293 | `lastLoginDate` datetime DEFAULT NULL, 1294 | `lastLoginAttemptIPAddress` varchar(45) COLLATE utf8_unicode_ci DEFAULT NULL, 1295 | `invalidLoginWindowStart` datetime DEFAULT NULL, 1296 | `invalidLoginCount` tinyint(4) unsigned DEFAULT NULL, 1297 | `lastInvalidLoginDate` datetime DEFAULT NULL, 1298 | `lockoutDate` datetime DEFAULT NULL, 1299 | `verificationCode` char(100) COLLATE utf8_unicode_ci DEFAULT NULL, 1300 | `verificationCodeIssuedDate` datetime DEFAULT NULL, 1301 | `unverifiedEmail` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, 1302 | `passwordResetRequired` tinyint(1) unsigned NOT NULL DEFAULT '0', 1303 | `lastPasswordChangeDate` datetime DEFAULT NULL, 1304 | `dateCreated` datetime NOT NULL, 1305 | `dateUpdated` datetime NOT NULL, 1306 | `uid` char(36) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', 1307 | PRIMARY KEY (`id`), 1308 | UNIQUE KEY `craft_users_username_unq_idx` (`username`), 1309 | UNIQUE KEY `craft_users_email_unq_idx` (`email`), 1310 | KEY `craft_users_verificationCode_idx` (`verificationCode`), 1311 | KEY `craft_users_uid_idx` (`uid`), 1312 | KEY `craft_users_preferredLocale_fk` (`preferredLocale`) 1313 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 1314 | 1315 | -- 1316 | -- Data for table `craft_users` 1317 | -- 1318 | 1319 | INSERT INTO `craft_users` (`id`, `username`, `photo`, `firstName`, `lastName`, `email`, `password`, `preferredLocale`, `weekStartDay`, `admin`, `client`, `locked`, `suspended`, `pending`, `archived`, `lastLoginDate`, `lastLoginAttemptIPAddress`, `invalidLoginWindowStart`, `invalidLoginCount`, `lastInvalidLoginDate`, `lockoutDate`, `verificationCode`, `verificationCodeIssuedDate`, `unverifiedEmail`, `passwordResetRequired`, `lastPasswordChangeDate`, `dateCreated`, `dateUpdated`, `uid`) VALUES 1320 | ('1', 'admin@admin.com', NULL, NULL, NULL, 'admin@admin.com', '$2y$13$ujqs6ltVE53QOsqyoO3VheqxWauX.cyFx9hmfLzfCJPqQwXqCp62K', NULL, '0', '1', '0', '0', '0', '0', '0', '2016-05-02 03:39:11', '192.168.10.1', NULL, NULL, NULL, NULL, NULL, NULL, NULL, '0', '2016-05-02 03:39:11', '2016-05-02 03:39:11', '2016-05-02 03:39:12', '00667ed8-df1c-4659-83e5-b1e2dfc83e2a'); 1321 | 1322 | 1323 | 1324 | DROP TABLE IF EXISTS `craft_widgets`; 1325 | 1326 | 1327 | -- 1328 | -- Schema for table `craft_widgets` 1329 | -- 1330 | CREATE TABLE `craft_widgets` ( 1331 | `id` int(11) NOT NULL AUTO_INCREMENT, 1332 | `userId` int(11) NOT NULL, 1333 | `type` varchar(150) COLLATE utf8_unicode_ci NOT NULL, 1334 | `sortOrder` smallint(6) unsigned DEFAULT NULL, 1335 | `colspan` tinyint(4) unsigned DEFAULT NULL, 1336 | `settings` text COLLATE utf8_unicode_ci, 1337 | `enabled` tinyint(1) unsigned NOT NULL DEFAULT '1', 1338 | `dateCreated` datetime NOT NULL, 1339 | `dateUpdated` datetime NOT NULL, 1340 | `uid` char(36) COLLATE utf8_unicode_ci NOT NULL DEFAULT '0', 1341 | PRIMARY KEY (`id`), 1342 | KEY `craft_widgets_userId_fk` (`userId`) 1343 | ) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; 1344 | 1345 | -- 1346 | -- Data for table `craft_widgets` 1347 | -- 1348 | 1349 | INSERT INTO `craft_widgets` (`id`, `userId`, `type`, `sortOrder`, `colspan`, `settings`, `enabled`, `dateCreated`, `dateUpdated`, `uid`) VALUES 1350 | ('1', '1', 'RecentEntries', '1', NULL, NULL, '1', '2016-05-02 03:39:16', '2016-05-02 03:39:16', 'a8c43260-4f2c-489e-aa44-bf11b4022dc0'), 1351 | ('2', '1', 'GetHelp', '2', NULL, NULL, '1', '2016-05-02 03:39:16', '2016-05-02 03:39:16', '629e2c6a-7266-4ddd-a553-36eb0498277e'), 1352 | ('3', '1', 'Updates', '3', NULL, NULL, '1', '2016-05-02 03:39:16', '2016-05-02 03:39:16', '80494aa0-b139-4d2d-98d1-2a48a0e53854'), 1353 | ('4', '1', 'Feed', '4', NULL, '{\"url\":\"https:\\/\\/craftcms.com\\/news.rss\",\"title\":\"Craft News\"}', '1', '2016-05-02 03:39:16', '2016-05-02 03:39:16', '7a08fdde-71b7-4172-be59-9a01ced2412d'); 1354 | 1355 | 1356 | -- 1357 | -- Constraints for tables 1358 | -- 1359 | 1360 | 1361 | -- 1362 | -- Constraints for table `craft_assetfiles` 1363 | -- 1364 | ALTER TABLE `craft_assetfiles` 1365 | ADD CONSTRAINT `craft_assetfiles_folderId_fk` FOREIGN KEY (`folderId`) REFERENCES `craft_assetfolders` (`id`) ON DELETE CASCADE, 1366 | ADD CONSTRAINT `craft_assetfiles_id_fk` FOREIGN KEY (`id`) REFERENCES `craft_elements` (`id`) ON DELETE CASCADE, 1367 | ADD CONSTRAINT `craft_assetfiles_sourceId_fk` FOREIGN KEY (`sourceId`) REFERENCES `craft_assetsources` (`id`) ON DELETE CASCADE; 1368 | 1369 | -- 1370 | -- Constraints for table `craft_assetfolders` 1371 | -- 1372 | ALTER TABLE `craft_assetfolders` 1373 | ADD CONSTRAINT `craft_assetfolders_parentId_fk` FOREIGN KEY (`parentId`) REFERENCES `craft_assetfolders` (`id`) ON DELETE CASCADE, 1374 | ADD CONSTRAINT `craft_assetfolders_sourceId_fk` FOREIGN KEY (`sourceId`) REFERENCES `craft_assetsources` (`id`) ON DELETE CASCADE; 1375 | 1376 | -- 1377 | -- Constraints for table `craft_assetindexdata` 1378 | -- 1379 | ALTER TABLE `craft_assetindexdata` 1380 | ADD CONSTRAINT `craft_assetindexdata_sourceId_fk` FOREIGN KEY (`sourceId`) REFERENCES `craft_assetsources` (`id`) ON DELETE CASCADE; 1381 | 1382 | -- 1383 | -- Constraints for table `craft_assetsources` 1384 | -- 1385 | ALTER TABLE `craft_assetsources` 1386 | ADD CONSTRAINT `craft_assetsources_fieldLayoutId_fk` FOREIGN KEY (`fieldLayoutId`) REFERENCES `craft_fieldlayouts` (`id`) ON DELETE SET NULL; 1387 | 1388 | -- 1389 | -- Constraints for table `craft_categories` 1390 | -- 1391 | ALTER TABLE `craft_categories` 1392 | ADD CONSTRAINT `craft_categories_groupId_fk` FOREIGN KEY (`groupId`) REFERENCES `craft_categorygroups` (`id`) ON DELETE CASCADE, 1393 | ADD CONSTRAINT `craft_categories_id_fk` FOREIGN KEY (`id`) REFERENCES `craft_elements` (`id`) ON DELETE CASCADE; 1394 | 1395 | -- 1396 | -- Constraints for table `craft_categorygroups` 1397 | -- 1398 | ALTER TABLE `craft_categorygroups` 1399 | ADD CONSTRAINT `craft_categorygroups_fieldLayoutId_fk` FOREIGN KEY (`fieldLayoutId`) REFERENCES `craft_fieldlayouts` (`id`) ON DELETE SET NULL, 1400 | ADD CONSTRAINT `craft_categorygroups_structureId_fk` FOREIGN KEY (`structureId`) REFERENCES `craft_structures` (`id`) ON DELETE CASCADE; 1401 | 1402 | -- 1403 | -- Constraints for table `craft_categorygroups_i18n` 1404 | -- 1405 | ALTER TABLE `craft_categorygroups_i18n` 1406 | ADD CONSTRAINT `craft_categorygroups_i18n_groupId_fk` FOREIGN KEY (`groupId`) REFERENCES `craft_categorygroups` (`id`) ON DELETE CASCADE, 1407 | ADD CONSTRAINT `craft_categorygroups_i18n_locale_fk` FOREIGN KEY (`locale`) REFERENCES `craft_locales` (`locale`) ON DELETE CASCADE ON UPDATE CASCADE; 1408 | 1409 | -- 1410 | -- Constraints for table `craft_content` 1411 | -- 1412 | ALTER TABLE `craft_content` 1413 | ADD CONSTRAINT `craft_content_elementId_fk` FOREIGN KEY (`elementId`) REFERENCES `craft_elements` (`id`) ON DELETE CASCADE, 1414 | ADD CONSTRAINT `craft_content_locale_fk` FOREIGN KEY (`locale`) REFERENCES `craft_locales` (`locale`) ON DELETE CASCADE ON UPDATE CASCADE; 1415 | 1416 | -- 1417 | -- Constraints for table `craft_elements_i18n` 1418 | -- 1419 | ALTER TABLE `craft_elements_i18n` 1420 | ADD CONSTRAINT `craft_elements_i18n_elementId_fk` FOREIGN KEY (`elementId`) REFERENCES `craft_elements` (`id`) ON DELETE CASCADE, 1421 | ADD CONSTRAINT `craft_elements_i18n_locale_fk` FOREIGN KEY (`locale`) REFERENCES `craft_locales` (`locale`) ON DELETE CASCADE ON UPDATE CASCADE; 1422 | 1423 | -- 1424 | -- Constraints for table `craft_emailmessages` 1425 | -- 1426 | ALTER TABLE `craft_emailmessages` 1427 | ADD CONSTRAINT `craft_emailmessages_locale_fk` FOREIGN KEY (`locale`) REFERENCES `craft_locales` (`locale`) ON DELETE CASCADE ON UPDATE CASCADE; 1428 | 1429 | -- 1430 | -- Constraints for table `craft_entries` 1431 | -- 1432 | ALTER TABLE `craft_entries` 1433 | ADD CONSTRAINT `craft_entries_authorId_fk` FOREIGN KEY (`authorId`) REFERENCES `craft_users` (`id`) ON DELETE CASCADE, 1434 | ADD CONSTRAINT `craft_entries_id_fk` FOREIGN KEY (`id`) REFERENCES `craft_elements` (`id`) ON DELETE CASCADE, 1435 | ADD CONSTRAINT `craft_entries_sectionId_fk` FOREIGN KEY (`sectionId`) REFERENCES `craft_sections` (`id`) ON DELETE CASCADE, 1436 | ADD CONSTRAINT `craft_entries_typeId_fk` FOREIGN KEY (`typeId`) REFERENCES `craft_entrytypes` (`id`) ON DELETE CASCADE; 1437 | 1438 | -- 1439 | -- Constraints for table `craft_entrydrafts` 1440 | -- 1441 | ALTER TABLE `craft_entrydrafts` 1442 | ADD CONSTRAINT `craft_entrydrafts_creatorId_fk` FOREIGN KEY (`creatorId`) REFERENCES `craft_users` (`id`) ON DELETE CASCADE, 1443 | ADD CONSTRAINT `craft_entrydrafts_entryId_fk` FOREIGN KEY (`entryId`) REFERENCES `craft_entries` (`id`) ON DELETE CASCADE, 1444 | ADD CONSTRAINT `craft_entrydrafts_locale_fk` FOREIGN KEY (`locale`) REFERENCES `craft_locales` (`locale`) ON DELETE CASCADE ON UPDATE CASCADE, 1445 | ADD CONSTRAINT `craft_entrydrafts_sectionId_fk` FOREIGN KEY (`sectionId`) REFERENCES `craft_sections` (`id`) ON DELETE CASCADE; 1446 | 1447 | -- 1448 | -- Constraints for table `craft_entrytypes` 1449 | -- 1450 | ALTER TABLE `craft_entrytypes` 1451 | ADD CONSTRAINT `craft_entrytypes_fieldLayoutId_fk` FOREIGN KEY (`fieldLayoutId`) REFERENCES `craft_fieldlayouts` (`id`) ON DELETE SET NULL, 1452 | ADD CONSTRAINT `craft_entrytypes_sectionId_fk` FOREIGN KEY (`sectionId`) REFERENCES `craft_sections` (`id`) ON DELETE CASCADE; 1453 | 1454 | -- 1455 | -- Constraints for table `craft_entryversions` 1456 | -- 1457 | ALTER TABLE `craft_entryversions` 1458 | ADD CONSTRAINT `craft_entryversions_creatorId_fk` FOREIGN KEY (`creatorId`) REFERENCES `craft_users` (`id`) ON DELETE SET NULL, 1459 | ADD CONSTRAINT `craft_entryversions_entryId_fk` FOREIGN KEY (`entryId`) REFERENCES `craft_entries` (`id`) ON DELETE CASCADE, 1460 | ADD CONSTRAINT `craft_entryversions_locale_fk` FOREIGN KEY (`locale`) REFERENCES `craft_locales` (`locale`) ON DELETE CASCADE ON UPDATE CASCADE, 1461 | ADD CONSTRAINT `craft_entryversions_sectionId_fk` FOREIGN KEY (`sectionId`) REFERENCES `craft_sections` (`id`) ON DELETE CASCADE; 1462 | 1463 | -- 1464 | -- Constraints for table `craft_fieldlayoutfields` 1465 | -- 1466 | ALTER TABLE `craft_fieldlayoutfields` 1467 | ADD CONSTRAINT `craft_fieldlayoutfields_fieldId_fk` FOREIGN KEY (`fieldId`) REFERENCES `craft_fields` (`id`) ON DELETE CASCADE, 1468 | ADD CONSTRAINT `craft_fieldlayoutfields_layoutId_fk` FOREIGN KEY (`layoutId`) REFERENCES `craft_fieldlayouts` (`id`) ON DELETE CASCADE, 1469 | ADD CONSTRAINT `craft_fieldlayoutfields_tabId_fk` FOREIGN KEY (`tabId`) REFERENCES `craft_fieldlayouttabs` (`id`) ON DELETE CASCADE; 1470 | 1471 | -- 1472 | -- Constraints for table `craft_fieldlayouttabs` 1473 | -- 1474 | ALTER TABLE `craft_fieldlayouttabs` 1475 | ADD CONSTRAINT `craft_fieldlayouttabs_layoutId_fk` FOREIGN KEY (`layoutId`) REFERENCES `craft_fieldlayouts` (`id`) ON DELETE CASCADE; 1476 | 1477 | -- 1478 | -- Constraints for table `craft_fields` 1479 | -- 1480 | ALTER TABLE `craft_fields` 1481 | ADD CONSTRAINT `craft_fields_groupId_fk` FOREIGN KEY (`groupId`) REFERENCES `craft_fieldgroups` (`id`) ON DELETE CASCADE; 1482 | 1483 | -- 1484 | -- Constraints for table `craft_globalsets` 1485 | -- 1486 | ALTER TABLE `craft_globalsets` 1487 | ADD CONSTRAINT `craft_globalsets_fieldLayoutId_fk` FOREIGN KEY (`fieldLayoutId`) REFERENCES `craft_fieldlayouts` (`id`) ON DELETE SET NULL, 1488 | ADD CONSTRAINT `craft_globalsets_id_fk` FOREIGN KEY (`id`) REFERENCES `craft_elements` (`id`) ON DELETE CASCADE; 1489 | 1490 | -- 1491 | -- Constraints for table `craft_matrixblocks` 1492 | -- 1493 | ALTER TABLE `craft_matrixblocks` 1494 | ADD CONSTRAINT `craft_matrixblocks_fieldId_fk` FOREIGN KEY (`fieldId`) REFERENCES `craft_fields` (`id`) ON DELETE CASCADE, 1495 | ADD CONSTRAINT `craft_matrixblocks_id_fk` FOREIGN KEY (`id`) REFERENCES `craft_elements` (`id`) ON DELETE CASCADE, 1496 | ADD CONSTRAINT `craft_matrixblocks_ownerId_fk` FOREIGN KEY (`ownerId`) REFERENCES `craft_elements` (`id`) ON DELETE CASCADE, 1497 | ADD CONSTRAINT `craft_matrixblocks_ownerLocale_fk` FOREIGN KEY (`ownerLocale`) REFERENCES `craft_locales` (`locale`) ON DELETE CASCADE ON UPDATE CASCADE, 1498 | ADD CONSTRAINT `craft_matrixblocks_typeId_fk` FOREIGN KEY (`typeId`) REFERENCES `craft_matrixblocktypes` (`id`) ON DELETE CASCADE; 1499 | 1500 | -- 1501 | -- Constraints for table `craft_matrixblocktypes` 1502 | -- 1503 | ALTER TABLE `craft_matrixblocktypes` 1504 | ADD CONSTRAINT `craft_matrixblocktypes_fieldId_fk` FOREIGN KEY (`fieldId`) REFERENCES `craft_fields` (`id`) ON DELETE CASCADE, 1505 | ADD CONSTRAINT `craft_matrixblocktypes_fieldLayoutId_fk` FOREIGN KEY (`fieldLayoutId`) REFERENCES `craft_fieldlayouts` (`id`) ON DELETE SET NULL; 1506 | 1507 | -- 1508 | -- Constraints for table `craft_migrations` 1509 | -- 1510 | ALTER TABLE `craft_migrations` 1511 | ADD CONSTRAINT `craft_migrations_pluginId_fk` FOREIGN KEY (`pluginId`) REFERENCES `craft_plugins` (`id`) ON DELETE CASCADE; 1512 | 1513 | -- 1514 | -- Constraints for table `craft_relations` 1515 | -- 1516 | ALTER TABLE `craft_relations` 1517 | ADD CONSTRAINT `craft_relations_fieldId_fk` FOREIGN KEY (`fieldId`) REFERENCES `craft_fields` (`id`) ON DELETE CASCADE, 1518 | ADD CONSTRAINT `craft_relations_sourceId_fk` FOREIGN KEY (`sourceId`) REFERENCES `craft_elements` (`id`) ON DELETE CASCADE, 1519 | ADD CONSTRAINT `craft_relations_sourceLocale_fk` FOREIGN KEY (`sourceLocale`) REFERENCES `craft_locales` (`locale`) ON DELETE CASCADE ON UPDATE CASCADE, 1520 | ADD CONSTRAINT `craft_relations_targetId_fk` FOREIGN KEY (`targetId`) REFERENCES `craft_elements` (`id`) ON DELETE CASCADE; 1521 | 1522 | -- 1523 | -- Constraints for table `craft_routes` 1524 | -- 1525 | ALTER TABLE `craft_routes` 1526 | ADD CONSTRAINT `craft_routes_locale_fk` FOREIGN KEY (`locale`) REFERENCES `craft_locales` (`locale`) ON DELETE CASCADE ON UPDATE CASCADE; 1527 | 1528 | -- 1529 | -- Constraints for table `craft_sections` 1530 | -- 1531 | ALTER TABLE `craft_sections` 1532 | ADD CONSTRAINT `craft_sections_structureId_fk` FOREIGN KEY (`structureId`) REFERENCES `craft_structures` (`id`) ON DELETE SET NULL; 1533 | 1534 | -- 1535 | -- Constraints for table `craft_sections_i18n` 1536 | -- 1537 | ALTER TABLE `craft_sections_i18n` 1538 | ADD CONSTRAINT `craft_sections_i18n_locale_fk` FOREIGN KEY (`locale`) REFERENCES `craft_locales` (`locale`) ON DELETE CASCADE ON UPDATE CASCADE, 1539 | ADD CONSTRAINT `craft_sections_i18n_sectionId_fk` FOREIGN KEY (`sectionId`) REFERENCES `craft_sections` (`id`) ON DELETE CASCADE; 1540 | 1541 | -- 1542 | -- Constraints for table `craft_sessions` 1543 | -- 1544 | ALTER TABLE `craft_sessions` 1545 | ADD CONSTRAINT `craft_sessions_userId_fk` FOREIGN KEY (`userId`) REFERENCES `craft_users` (`id`) ON DELETE CASCADE; 1546 | 1547 | -- 1548 | -- Constraints for table `craft_shunnedmessages` 1549 | -- 1550 | ALTER TABLE `craft_shunnedmessages` 1551 | ADD CONSTRAINT `craft_shunnedmessages_userId_fk` FOREIGN KEY (`userId`) REFERENCES `craft_users` (`id`) ON DELETE CASCADE; 1552 | 1553 | -- 1554 | -- Constraints for table `craft_structureelements` 1555 | -- 1556 | ALTER TABLE `craft_structureelements` 1557 | ADD CONSTRAINT `craft_structureelements_elementId_fk` FOREIGN KEY (`elementId`) REFERENCES `craft_elements` (`id`) ON DELETE CASCADE, 1558 | ADD CONSTRAINT `craft_structureelements_structureId_fk` FOREIGN KEY (`structureId`) REFERENCES `craft_structures` (`id`) ON DELETE CASCADE; 1559 | 1560 | -- 1561 | -- Constraints for table `craft_taggroups` 1562 | -- 1563 | ALTER TABLE `craft_taggroups` 1564 | ADD CONSTRAINT `craft_taggroups_fieldLayoutId_fk` FOREIGN KEY (`fieldLayoutId`) REFERENCES `craft_fieldlayouts` (`id`) ON DELETE SET NULL; 1565 | 1566 | -- 1567 | -- Constraints for table `craft_tags` 1568 | -- 1569 | ALTER TABLE `craft_tags` 1570 | ADD CONSTRAINT `craft_tags_groupId_fk` FOREIGN KEY (`groupId`) REFERENCES `craft_taggroups` (`id`) ON DELETE CASCADE, 1571 | ADD CONSTRAINT `craft_tags_id_fk` FOREIGN KEY (`id`) REFERENCES `craft_elements` (`id`) ON DELETE CASCADE; 1572 | 1573 | -- 1574 | -- Constraints for table `craft_templatecachecriteria` 1575 | -- 1576 | ALTER TABLE `craft_templatecachecriteria` 1577 | ADD CONSTRAINT `craft_templatecachecriteria_cacheId_fk` FOREIGN KEY (`cacheId`) REFERENCES `craft_templatecaches` (`id`) ON DELETE CASCADE; 1578 | 1579 | -- 1580 | -- Constraints for table `craft_templatecacheelements` 1581 | -- 1582 | ALTER TABLE `craft_templatecacheelements` 1583 | ADD CONSTRAINT `craft_templatecacheelements_cacheId_fk` FOREIGN KEY (`cacheId`) REFERENCES `craft_templatecaches` (`id`) ON DELETE CASCADE, 1584 | ADD CONSTRAINT `craft_templatecacheelements_elementId_fk` FOREIGN KEY (`elementId`) REFERENCES `craft_elements` (`id`) ON DELETE CASCADE; 1585 | 1586 | -- 1587 | -- Constraints for table `craft_templatecaches` 1588 | -- 1589 | ALTER TABLE `craft_templatecaches` 1590 | ADD CONSTRAINT `craft_templatecaches_locale_fk` FOREIGN KEY (`locale`) REFERENCES `craft_locales` (`locale`) ON DELETE CASCADE ON UPDATE CASCADE; 1591 | 1592 | -- 1593 | -- Constraints for table `craft_usergroups_users` 1594 | -- 1595 | ALTER TABLE `craft_usergroups_users` 1596 | ADD CONSTRAINT `craft_usergroups_users_groupId_fk` FOREIGN KEY (`groupId`) REFERENCES `craft_usergroups` (`id`) ON DELETE CASCADE, 1597 | ADD CONSTRAINT `craft_usergroups_users_userId_fk` FOREIGN KEY (`userId`) REFERENCES `craft_users` (`id`) ON DELETE CASCADE; 1598 | 1599 | -- 1600 | -- Constraints for table `craft_userpermissions_usergroups` 1601 | -- 1602 | ALTER TABLE `craft_userpermissions_usergroups` 1603 | ADD CONSTRAINT `craft_userpermissions_usergroups_groupId_fk` FOREIGN KEY (`groupId`) REFERENCES `craft_usergroups` (`id`) ON DELETE CASCADE, 1604 | ADD CONSTRAINT `craft_userpermissions_usergroups_permissionId_fk` FOREIGN KEY (`permissionId`) REFERENCES `craft_userpermissions` (`id`) ON DELETE CASCADE; 1605 | 1606 | -- 1607 | -- Constraints for table `craft_userpermissions_users` 1608 | -- 1609 | ALTER TABLE `craft_userpermissions_users` 1610 | ADD CONSTRAINT `craft_userpermissions_users_permissionId_fk` FOREIGN KEY (`permissionId`) REFERENCES `craft_userpermissions` (`id`) ON DELETE CASCADE, 1611 | ADD CONSTRAINT `craft_userpermissions_users_userId_fk` FOREIGN KEY (`userId`) REFERENCES `craft_users` (`id`) ON DELETE CASCADE; 1612 | 1613 | -- 1614 | -- Constraints for table `craft_users` 1615 | -- 1616 | ALTER TABLE `craft_users` 1617 | ADD CONSTRAINT `craft_users_id_fk` FOREIGN KEY (`id`) REFERENCES `craft_elements` (`id`) ON DELETE CASCADE, 1618 | ADD CONSTRAINT `craft_users_preferredLocale_fk` FOREIGN KEY (`preferredLocale`) REFERENCES `craft_locales` (`locale`) ON DELETE SET NULL ON UPDATE CASCADE; 1619 | 1620 | -- 1621 | -- Constraints for table `craft_widgets` 1622 | -- 1623 | ALTER TABLE `craft_widgets` 1624 | ADD CONSTRAINT `craft_widgets_userId_fk` FOREIGN KEY (`userId`) REFERENCES `craft_users` (`id`) ON DELETE CASCADE; 1625 | 1626 | SET FOREIGN_KEY_CHECKS = 1; 1627 | --------------------------------------------------------------------------------