Models statt nur Migrations generiert. Damit auch die Attribute in die DB bekommen.

This commit is contained in:
gchq 2011-05-04 22:50:36 +02:00
parent 8992818890
commit 3f1c7b6190
16 changed files with 159 additions and 36 deletions

View file

@ -1,7 +0,0 @@
class CreateContacts < ActiveRecord::Migration
def self.up
end
def self.down
end
end

View file

@ -1,7 +0,0 @@
class CreateMailsForContacts < ActiveRecord::Migration
def self.up
end
def self.down
end
end

View file

@ -1,7 +0,0 @@
class CreatePhonesForContacts < ActiveRecord::Migration
def self.up
end
def self.down
end
end

View file

@ -0,0 +1,19 @@
class CreateContacts < ActiveRecord::Migration
def self.up
create_table :contacts do |t|
t.string :firstname
t.string :lastname
t.string :street
t.string :housenr
t.string :plz
t.string :place
t.string :country
t.timestamps
end
end
def self.down
drop_table :contacts
end
end

View file

@ -0,0 +1,14 @@
class CreateMails < ActiveRecord::Migration
def self.up
create_table :mails do |t|
t.string :desc
t.string :address
t.timestamps
end
end
def self.down
drop_table :mails
end
end

View file

@ -0,0 +1,14 @@
class CreatePhones < ActiveRecord::Migration
def self.up
create_table :phones do |t|
t.string :desc
t.string :nr
t.timestamps
end
end
def self.down
drop_table :phones
end
end

View file

@ -1,15 +1,41 @@
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your
# database schema. If you need to create the application database on another
# system, you should be using db:schema:load, not running all the migrations
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
# you'll amass, the slower it'll run and the greater likelihood for issues).
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20110502221705) do
end
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# Note that this schema.rb definition is the authoritative source for your
# database schema. If you need to create the application database on another
# system, you should be using db:schema:load, not running all the migrations
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
# you'll amass, the slower it'll run and the greater likelihood for issues).
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20110504202804) do
create_table "contacts", :force => true do |t|
t.string "firstname"
t.string "lastname"
t.string "street"
t.string "housenr"
t.string "plz"
t.string "place"
t.string "country"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "mails", :force => true do |t|
t.string "desc"
t.string "address"
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "phones", :force => true do |t|
t.string "desc"
t.string "nr"
t.datetime "created_at"
t.datetime "updated_at"
end
end