Migrations Carol Wolf CS 396X. ISBNTitleAuthorImage 1234-5678EmmaAustenemma.jpg 2345-6789Oliver TwistDickenstwist.jpg 3456-7890HamletShakespearehamlet.jpg.

Slides:



Advertisements
Similar presentations
Database vocabulary. Data Information entered in a database.
Advertisements

The Librarian Web Page Carol Wolf CS396X. Create new controller  To create a new controller that can manage more than just books, type ruby script/generate.
Trestle Generator Industrial-strength scaffolding for Ruby on Rails web application development.
Creating rails app. p:\InstantRails\rails_apps>rails -d mysql cars create create app/controllers create app/helpers create app/models create app/views/layouts.
Ruby on Rails Model of MVC. Model-View-Controller Paradigm A way of organizing a software system Benefits: Isolation of business logic from the user interface.
Structured Query Language - SQL Carol Wolf Computer Science.
Representing Data Elements Gayatri Gopalakrishnan.
CS 142 Lecture Notes: Rails ActiveRecordSlide 1 Model for Student Table SELECT * FROM students; | id | name.
CS 128/ES Lecture 6a1 Attribute Data CampusIDNameTypeFloorsFootprint 6MurphyAcademic HopkinsSupport MaintenanceSupport HickeySupport22367.
Designing a Database Unleashing the Power of Relational Database Design.
Table design screen Field name Data type Field size Other properties.
Rails Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce.
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.
SQL Exercises1 Revising RDB and SQL CTEC2902 Advanced Programming.
Database – Part 2a Dr. V.T. Raja Oregon State University.
CS 128/ES Lecture 6a1 Attribute Data CampusIDNameTypeFloorsFootprint 6MurphyAcademic HopkinsSupport MaintenanceSupport HickeySupport22367.
Ruby on Rails Creating a Rails Application Carol E Wolf CS396X.
Database Software Application
Ruby on Rails: An Introduction JA-SIG Summer Conference 2007 Michael Irion The University of Tulsa.
1 Dr Alexiei Dingli Web Science Stream Models, Views and Controllers.
Taking ActiveRecord to the Next Level Blythe Dunham
BUS1MIS Management Information Systems Semester 1, 2012 Access: Creating a Database Week 6 Lecture 2.
Database Management System Lecture 4 The Relational Database Model- Introduction, Relational Database Concepts.
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.
Chapter 4 Introduction to MySQL. MySQL “the world’s most popular open-source database application” “commonly used with PHP”
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.
5 5 Data types Logical/Boolean Has only two alternatives: Yes or no, on or off true or false Text/Alphanumeric Refers to all letters and numbers and other.
Database Essentials. Key Terms Big Data Describes a dataset that cannot be stored or processed using traditional database software. Examples: Google search.
© Copyright IBM Corporation 2007 AP/Americas April 15-18, 2007 Anaheim, California Introduction to RubyOnRails - a J2EE replacement? Russell Scheerer –
ATADESAB. BATLE CORDER DLEIF Lesson objectives In this lesson you will learn some basic database terms and learn how a database is created.
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.
MS Access. Access is a DBMS/RDMS DBMS = Database Management System RDMS = Relational Database Management System.
INFORMATION TECHNOLOGY DATABASE MANAGEMENT. Adding a new field 1Right click the table name and select design view 2Type the field information at the end.
Testing Carol Wolf Computer Science. Testing built into Rails  Rails comes with three databases.  development  test  production  The test database.
Relational Databases. Relational database  data stored in tables  must put data into the correct tables  define relationship between tables  primary.
Unit 5 Advanced Databases The Purpose and features of a relational database.
1 Migration. 2 What’s Migration? Migration –Isolates database differences Allows you to write schema updates without worries about differences –Helps.
CS 142 Lecture Notes: Rails ActiveRecordSlide 1 Model for Student Table SELECT * FROM students; | id | name.
Planning & Creating a Database By Ms. Naira Microsoft Access.
A table is a set of data elements (values) that is organized using a model of vertical columns (which are identified by their name) and horizontal rows.
Introduction to Ruby&Rails Yuri Veremeyenko Monica Verma.
McGraw-Hill Career Education© 2008 by the McGraw-Hill Companies, Inc. All Rights Reserved. Concept 1 Database – Organized collection of related information.
Chapter 13.3: Databases Invitation to Computer Science, Java Version, Second Edition.
* Database is a group of related objects * Objects can be Tables, Forms, Queries or Reports * All data reside in Tables * A Row in a Table is a record.
Adding Data to a Database Table Carol Wolf Computer Science.
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.
Howard Paul. Sequential Access Index Files and Data File Random Access.
INFORMATION TECHNOLOGY DATABASE MANAGEMENT. A database is a collection of information organized to provide efficient retrieval. The collected information.
Data Please use speaker notes for additional information!
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.
Notes: **A Row is considered one Record. **A Column is a Field. A Database is…  an organized set of stored information usually on one topic  a collection.
Data Modeling.
Database Access with SQL
Database Management  .
INFO/CSE 100, Spring 2005 Fluency in Information Technology
Agile Web Development with Ruby and Rails
Model for Student Table
PHP and MySQL.
Chapter 15 Introduction to Rails.
Database.
Model for Student Table
Chapter 4 Introduction to MySQL.
Microsoft Access Date.
Presentation transcript:

Migrations Carol Wolf CS 396X

ISBNTitleAuthorImage EmmaAustenemma.jpg Oliver TwistDickenstwist.jpg HamletShakespearehamlet.jpg Relational Databases  A relational database consists of a number of different tables.  Each table is like a two dimensional array.  The columns show the attributes (fields) of the data.  The rows each store information about a single item.  The first column stores the ISBNs for each book.  The first row stores information about Emma by Jane Austen.

Creating a table in Rails  InstantRails supplies an empty database called development.sqlite3.  A table is created by a migration. ruby script/generate scaffold book isbn:string author:string title:string  The resulting table will be called books and have the three columns named, above each holding a string.  It will also have several other columns supplied by Rails.  A primary key called id of type integer.  Timestamps of type date.  Rails gives the resulting Ruby program a name beginning with a timestamp, _create_books.rb.

Migration file to create a new table. class CreateBooks < ActiveRecord::Migration def self.up create_table :books do |t| t.string :isbn t.string :author t.string :title t.timestamps end def self.down drop_table :books end