Ibiza, June 6 th 2011 Advanced Database Install Scripts.

Slides:



Advertisements
Similar presentations
WordPress Installation for Beginners Sheila Bergman
Advertisements

Copyright © 2003 Pearson Education, Inc. Slide 8-1 The Web Wizards Guide to PHP by David Lash.
CakePHP. A framework for developing applications in PHP Inspired by Ruby on Rails Follows MVC design pattern Convention over configuration –No wheel reinventing.
Session 2Introduction to Database Technology Data Types and Table Creation.
© 2012 Entrinsik, Inc. Informer Administration Exploring the system menu and functions PRESENTER: Jason Vorenkamp| Informer Software Engineer| March 2012.
With Folder HelpDesk for Outlook, support centres and other helpdesks can work efficiently with support cases inside Microsoft Outlook. The support tickets.
1 Digital Memories Software Jim Gemmell Digital Memories (Memex) Workshop 7/19/2006.

Database Chapters.
PHP and MySQL Database. Connecting to MySQL Note: you need to make sure that you have MySQL software properly installed on your computer before you attempt.
SQL Server Accelerator for Business Intelligence (SSABI)
Raymond R. Balise Health Research and Policy
Microsoft Dynamics AX Technical Conference 2013
A Guide to MySQL 3. 2 Objectives Start MySQL and learn how to use the MySQL Reference Manual Create a database Change (activate) a database Create tables.
Virtual techdays INDIA │ august 2010 Building ASP.NET applications using SQL Server Compact Chaitanya Solapurkar │ Partner Technical Consultant,
©2011 Quest Software, Inc. All rights reserved. Steve Walch, Senior Product Manager Blog: November, 2011 Partner Training Webcast.
FileSecure Implementation Training Patch Management Version 1.1.
Batch Import/Export/Restore/Archive
Migration XenDesktop 7. © 2013 Citrix | Confidential – Do Not Distribute Migration prerequisites Set up a XenDesktop 7 Site, including the site database.
Lecture 3 – Data Storage with XML+AJAX and MySQL+socket.io
A Guide to SQL, Eighth Edition Chapter Three Creating Tables.
DotNetNuke v4 on ASP.NET v2 Stan Schultes Stan Schultes Enterprise architect / application developer Enterprise architect / application developer Conference.
Crystal Hoyer Program Manager IIS Team Preview of features that will be announced at MIX09 Please do not blog, take pictures or video of session.
Session 5: Working with MySQL iNET Academy Open Source Web Development.
FireRMS SQL Audit, Archiving & Purging Presented by Laura Small FireRMS Quality Assurance.
1 Chapter 8 – Working with Databases spring into PHP 5 by Steven Holzner Slides were developed by Jack Davis College of Information Science and Technology.
INTERNET APPLICATION DEVELOPMENT For More visit:
PostgreSQL and relational databases As well as assignment 4…
Copyright © 2003 Pearson Education, Inc. Slide 8-1 The Web Wizard’s Guide to PHP by David Lash.
Eurotrace Hands-On The Eurotrace File System. 2 The Eurotrace file system Under MS ACCESS EUROTRACE generates several different files when you create.
PostgreSQL and relational databases As well as assignment 4…
1 Working with MS SQL Server Textbook Chapter 14.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 Working with MSSQL Server Code:G0-C# Version: 1.0 Author: Pham Trung Hai CTD.
15/10/20151 PHP & MySQL 'Slide materials are based on W3Schools PHP tutorial, 'PHP website 'MySQL website.
Introduction to MySQL Lab no. 10 Advance Database Management System.
PHP MySQL Introduction. MySQL is the most popular open-source database system. What is MySQL? MySQL is a database. The data in MySQL is stored in database.
Web Scripting [PHP] CIS166AE Wednesdays 6:00pm – 9:50pm Rob Loy.
Open Source Server Side Scripting ECA 236 Open Source Server Side Scripting Installation and Testing.
PHP and MySQL CS How Web Site Architectures Work  User’s browser sends HTTP request.  The request may be a form where the action is to call PHP.
Database and mySQL Week 07 Dynamic Web TCNJ Jean Chu.
PHP on Windows Improvements in PHP-Microsoft Interoperability Brian Swan PHP Developer Outreach,
How to install Office 2007  Step 1: Insert the Microsoft Office 2007 Enterprise CD. If the Setup Wizard does not automatically begin, then click Start.
Customizing ClientSpace With Dataforms Tim Borntreger, Director of Client Services.
Creating PHPs to Insert, Update, and Delete Data CS 320.
CERN-PH-SFT-SPI August Ernesto Rivera Contents Context Automation Results To Do…
Dean Anderson Polk County, Oregon GIS in Action 2014 Modifying Open Source Software (A Case Study)
Creating a simple database This shows you how to set up a database using PHPMyAdmin (installed with WAMP)
MySQL Importing and creating a database. CSV (Comma Separated Values) file CSV = Comma Separated Values – they are simple text files containing data which.
DATABASE DEVELOPMENT WITH VSTS DATABASE EDITION By Chris Dahlberg ©2009 Aspect Software, Inc. All rights reserved. 1.
Class 3Intro to Databases Class 4 Simple Example of a Database We’re going to build a simple example of a database, which will allow us to register users.
Introduction to MySQL Ullman Chapter 4. Introduction MySQL most popular open-source database application Is commonly used with PHP We will learn basics.
DATABASE DEVELOPMENT WITH VISUAL STUDIO 2010 Chris Dahlberg 1.
: Information Retrieval อาจารย์ ธีภากรณ์ นฤมาณนลิณี
© 2003 By Default! A Free sample background from Slide 1 Week 3  Backend Construction  Create your own CRM Please Visit:
SQL pepper. Why SQL File I/O is a great deal of code Optimal file organization and indexing is critical and a great deal of code and theory implementation.
Introduction to MySQL  Working with MySQL and MySQL Workbench.
Programming for the Web MySQL Command Line Using PHP with MySQL Dónal Mulligan BSc MA
Managing Database objects in Visual Studio and Team Foundation Server Presented by Sean P SQL Saturday - Phoenix 2016.
Scribe Technical Workshop Adapter for OLE DB Import-Export Wizard September 13, 2007.
Upgrade on Windows 7. DownloadSoftware Download Software from link provided in Webliography: e/
1 Adding a Model. We have created an MVC web app project Added a controller class. Added a view class. Next we will add some classes for managing movies.
Database Keys and Constraints
TE004 Smart Change Management with Sage CRM Component Manager
Introduction to Web programming
Chapter 3 Installing and Using Software
…and web frameworks in general
ISC440: Web Programming 2 Server-side Scripting PHP 3
Developing a Model-View-Controller Component for Joomla Part 3
…and web frameworks in general
TN19-TCI: Integration and API management using TIBCO Cloud™ Integration
Presentation transcript:

Ibiza, June 6 th 2011 Advanced Database Install Scripts

Presentation Summary 1.What Are They and Why Are They Awesome? 2.Your First Magento Module Install Script 3.Upgrade Scripts 4.Combining Upgrade and Install Scripts 5.Utilizing The Installer Class 6.What Magento Is Doing Behind The Scenes 7.Tips & Tricks & Good Resources Advanced Database Install Scripts

My Background Jay El-Kaake, CANADA Worked with Magento in BETA stages Previous history at TELUS Inc, etc Developed Free Enhanced Admin Grid ext CEO of WDCA (WDCA.ca) Better Store Search (BetterStoreSearch.com) Sweet Tooth (SweetToothRewards.com) Advanced Database Install Scripts

1. What Are They and Why Are They Awesome? What are they? run code when the module first runs run code when the module updates elegantly build the database architecture Advanced Database Install Scripts Why are they awesome? Couples database architecture with software architecture Allows consistent migration when transporting Magento modules

1.Make sure you module is ready to go, but has never run on this store. 2.Add config.xml entry: 1.Set your version number 2.… Advanced Database Install Scripts 2. Your First Magento Module Install Script For this example we will use producthistory_setup and the TBT_Producthistory module at v Watch out: Magento only recognized version numbers >= 3 decimals!

1.Make sure you module is ready to go, but has never run on this store. 2.Add config.xml entry: 1.Set your version number 2.Set the resource setup class/connection 3.Define entities Advanced Database Install Scripts 2. Your First Magento Module Install Script TBT_Producthistory_Model producthistory_mysql4 TBT_Producthistory_Model_Mysql4 producthistory_revision...

1.Make sure you module is ready to go, but has never run on this store. 2.Add config.xml entry 3.In your module folder, add app/code/community/TBT/Producthistory/sql/producthistory_setup/mysql4- install php Runs if v1.0 is installed Advanced Database Install Scripts 2. Your First Magento Module Install Script

mysql4-install php may look like this: Advanced Database Install Scripts 2. Your First Magento Module Install Script $installer->run(" CREATE TABLE IF NOT EXISTS `{$this->getTable('producthistory_revision')}` ( `producthistory_revision_id` int(11) NOT NULL AUTO_INCREMENT, `store_id` int(11) DEFAULT NULL, `product_id` int(11) DEFAULT NULL, `revision_date` datetime DEFAULT NULL, `data_hash` text, PRIMARY KEY (`producthistory_revision_id`), UNIQUE KEY `producthistory_revision_id` (`producthistory_revision_id`) ) ENGINE=MyISAM DEFAULT CHARSET=UTF8; "); $installer = $this; $installer->startSetup(); $installer->endSetup();

1.Make sure you module is ready to go, but has never run on this store. 2.Add config.xml entry 3.In your module folder, add app/code/community/TBT/Producthistory/sql/producthistory_setup/mysql4- install php 4.Run the extension and see it go! Advanced Database Install Scripts 2. Your First Magento Module Install Script Time for an EPIC demo…

1.Make sure you module is ready to go, but has never run on this store. 2.Add config.xml entry 3.In your module folder, add app/code/community/TBT/Producthistory/sql/producthistory_setup/mysql4- install php 4.Run the extension and see it go! Advanced Database Install Scripts 2. Your First Magento Module Install Script Time for an EPIC demo…

Very similar, just use “upgrade” instead of install and set both versions Naming: mysql4-upgrade php This will run if module version is upgraded from v1 to v Advanced Database Install Scripts 3. Upgrade scripts Time for (another) EPIC Demo…

Scripts are run in sequential order, starting with biggest install. Advanced Database Install Scripts 4. Combining Upgrade and Install Scripts Example A: What order would these go in when installing v1.3? mysql4-install php mysql4-upgrade php mysql4-upgrade php

Scripts are run in sequential order, starting with biggest install. Advanced Database Install Scripts 4. Combining Upgrade and Install Scripts Example A: What order would these go in for installing v1.3? 1.mysql4-install php 2.mysql4-upgrade php 3.mysql4-upgrade php

Scripts are run in sequential order, starting with biggest install. Advanced Database Install Scripts 4. Combining Upgrade and Install Scripts Example B: What order would these go in for installing v1.3? mysql4-install php mysql4-install php mysql4-upgrade php mysql4-upgrade php

Scripts are run in sequential order, starting with biggest install. Advanced Database Install Scripts 4. Combining Upgrade and Install Scripts Example B: What order would these go in for installing v1.3? mysql4-install php mysql4-upgrade php 1.mysql4-install php 2.mysql4-upgrade php

Instead of putting core setup functions in the sql files 1.Specify Install class in config.xml Advanced Database Install Scripts 5. Utilizing the installer class TBT_Producthistory TBT_Producthistory_Model_Resource_Mysql4_Setup core_setup 2. Create class Example: app/…/Producthistory/Model/Resource/Mysql4/Setup.php

Advanced Database Install Scripts 6. What Magento Is Doing Behind The Scenes Magento core_resources table tracks versions installed mysql> select * from core_resource; | code | version | | adminnotification_setup | | | admin_setup | | | amazonpayments_setup | | | api_setup | | | backup_setup | | | bundle_setup | | | catalogindex_setup | | | cataloginventory_setup | | | catalogrule_setup | | …. | producthistory| | You can remove an entry to force DB scripts to re-run

Subscribe to Alan Storm’s Subscribe to our WDCA me at if you have any Download the 3-hour developed hack-a-thon extension here: Advanced Database Install Scripts 7. Tips & Tricks & Good Resources

Happy DB-installing with Magento!