1 Migration. 2 What’s Migration? Migration –Isolates database differences Allows you to write schema updates without worries about differences –Helps.

Slides:



Advertisements
Similar presentations
Introduction to ReportSmith and Effective Dated Tables
Advertisements

Creating Tables The basics, nothing pretty, but it works.
1 After completing this lesson, you will be able to: Create a database. Create a table using the Table Wizard. Create and modify a table in Design view.
Query Methods (SQL). What is SQL A programming language for databases. SQL (structured Query Language) It allows you add, edit, delete and run queries.
1 R elational D ata B ase A id Copyright © 2002 Sakman Software Corp.
Obtain Data from Other Sources Data you need to include in an Access database often already exists in another file: in another Access database, in a table.
Trestle Generator Industrial-strength scaffolding for Ruby on Rails web application development.
Creating Web Services with Ruby on Rails Robert Thew Internet and Web Systems II.
Ruby on Rails Tutorial Peter Mosca April, Ruby on Rails Tutorial Ruby History Invented 12 years ago in Japan by Yukihiro Matsumoto Spent first 5.
CS 142 Lecture Notes: Rails ActiveRecordSlide 1 Model for Student Table SELECT * FROM students; | id | name.
System Administration Accounts privileges, users and roles
Creating a wiki blog. Run apps that come with instant rails distribution select I /rails applications/open ruby console window Cd to cookbook or typo.
Triggers. What is a trigger? A trigger defines an action that the database should take when some event occurs in the application. It is triggered by an.
Database Backup and Recovery
Ruby on Rails Creating a Rails Application Carol E Wolf CS396X.
® IBM Software Group © 2006 IBM Corporation The Eclipse Data Perspective and Database Explorer This section describes how to use the Eclipse Data Perspective,
DB Audit Expert v1.1 for Oracle Copyright © SoftTree Technologies, Inc. This presentation is for DB Audit Expert for Oracle version 1.1 which.
Business Computer Information Systems Microsoft Office XP Access Review Lessons 1 through 5.
Ruby on Rails: An Introduction JA-SIG Summer Conference 2007 Michael Irion The University of Tulsa.
Authentication/Authorization INFO 2310: Topics in Web Design and Programming.
Rails and Grails. To get started Make sure you have java installed You can get the sdk and jre at:
1 Insert, Update and Delete Queries. 2 Return to you Address Book database. Insert a record.
1 Dr Alexiei Dingli Web Science Stream Models, Views and Controllers.
UC Berkeley Hello Rails. Review: MVC Goal: separate organization of data (model) from UI & presentation (view) by introducing controller –mediates user.
Entity Framework Code First End to End
BIT 286: Web Applications Lecture 04 : Thursday, January 15, 2015 ASP.Net MVC - Models.
1 Dr Alexiei Dingli Web Science Stream Advanced ROR.
You are going to work in pairs to produce a Maths board game.
Ruby on Rails Your first app. Rails files app/ Contains the controllers, models, views and assets for your application. You’ll focus on this folder for.
Oracle Sequences Sequences are an independent object in the database (not a data type) Sequences have a name and can be used anywhere a value is expected.
© Copyright IBM Corporation 2007 AP/Americas April 15-18, 2007 Anaheim, California Introduction to RubyOnRails - a J2EE replacement? Russell Scheerer –
1 Rake. 2 Automated Build Any non-trivial project needs facility to automate builds –Routine common tasks that need to be carried out several times a.
Database Unit Test MSSQL 2008 & VS 2010 Aung Kyaw Myo.
Indispensable tools for research at its best
Database Design. Referential Integrity : data in a table that links to data in another table must always work in such a way that following the link will.
CS1100: Data, Databases, Queries Action Queries CS11001Advanced Queries.
Associations INFO 2310: Topics in Web Design and Programming.
Chapter 15 © 2009 by Addison Wesley Longman, Inc Overview of Rails - Rails is a development framework for Web-based applications - Rails is written.
Photo Gallery INFO 2310: Topics in Web Design and Programming.
CS 142 Lecture Notes: Rails ActiveRecordSlide 1 Model for Student Table SELECT * FROM students; | id | name.
CS 142 Lecture Notes: Rails ActiveRecordSlide 1 Model for Student Table SELECT * FROM students; | id | name.
Ruby on Rails: Databases. Rails Database Familiar Table Concept Naming convention – lower case, plural (i.e. tweets) How to Access (find), Update, Delete.
A Brief Documentation.  Provides basic information about connection, server, and client.
Component 4: Introduction to Information and Computer Science Unit 6a Databases and SQL.
Course ILT Forms and queries Unit objectives Create forms by using AutoForm and the Form Wizard, and add or modify form headers and footers Open and enter.
Chapter 15 © 2013 by Pearson Overview of Rails - Rails is a development framework for Web-based applications - Based on MVC architecture for applications.
® IBM Software Group © 2006 IBM Corporation JSF File Upload Control This Learning Module describes the use of the JSF File Upload component – for allowing.
DataSet Your Database student test score Database Connection Your program needs to establish a connection to the database. Click on “Add New Data Source.”
Class Builder Tutorial Presented By- Amit Singh & Sylendra Prasad.
CS 142 Lecture Notes: Rails ActiveRecordSlide 1 Model for Student Table SELECT * FROM students; | id | name.
Learningcomputer.com SQL Server 2008 –Views, Functions and Stored Procedures.
Questions/problems with Data Export Wizard 27 Feb
Overview of the FIATOOLS web page Brief introduction to the DataMart Focus is on FIDO – Forest Inventory Data Online A tool that helps you produce summary.
Ruby on Rails & Databases. Active Record Active Record in Rails CRUD & Other Stuff Mapping Cardinalities Migrations Demo.
CS 160 and CMPE/SE 131 Software Engineering February 9 Class Meeting Department of Computer Science Department of Computer Engineering San José State University.
Migrations Carol Wolf CS 396X. ISBNTitleAuthorImage EmmaAustenemma.jpg Oliver TwistDickenstwist.jpg HamletShakespearehamlet.jpg.
CS1100: Data, Databases, Queries Action Queries CS11001Advanced Queries.
Advanced Migration By Aye Mon Tun.  To change database schema in consistent and easy way  In ruby code Migration? 11/25/2013 2Web Application Engineering.
Oracle Announced New In- Memory Database G1 Emre Eftelioglu, Fen Liu [09/27/13] 1 [1]
Data Modeling.
For Letters, Labels or s Mail Merge For Letters, Labels or s.
Access Lesson 14 Import and Export Data
© 2016, Mike Murach & Associates, Inc.
JCreator Setup Instructions
Agile Web Development with Ruby and Rails
Model for Student Table
Creating and Managing Database Tables
Model for Student Table
Topic 15 Lesson 1 – Action queries
Presentation transcript:

1 Migration

2 What’s Migration? Migration –Isolates database differences Allows you to write schema updates without worries about differences –Helps you keep up with changes not only to code, but to database schema in an iterative/agile development –Not only allows you to move forward, but also to roll back changes as well

3 How does it work? You run the rake migrate to migrate database Ruby code tells what to do You write a class (or generate and edit it) that inherits from ActiveRecord::Migration The up method moves it forward The down method moves it backward

4 But, how does it how where to go? Database has a special table with one column and one row of the version number Based on the current version, it knows to move forward by how many versions, one after another

5 Operations in Migration You can perform any of the following: create_table drop_table rename_table add_column rename_column change_column remove_column add_index remove_index

6 Creating a Migration We will play with Migrations for an Alumni application Creates a file 001_create_degree.rb

7 Let’s take it for a drive

8 Creating Table and Initializing

9 Making a Change

10 Change related… For irreversible options (like data deleted in move up) you can throw IrreversibleMigration exception

11 Some Extras What is you already have a schema that you’ve developed along the way without migration? rake db_schema_dump can to get a Migration file created for your existing schema rake db_schema_import can import schema file into the current database