Models statt nur Migrations generiert. Damit auch die Attribute in die DB bekommen.
This commit is contained in:
parent
8992818890
commit
3f1c7b6190
16 changed files with 159 additions and 36 deletions
|
|
@ -1,7 +0,0 @@
|
|||
class CreateContacts < ActiveRecord::Migration
|
||||
def self.up
|
||||
end
|
||||
|
||||
def self.down
|
||||
end
|
||||
end
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
class CreateMailsForContacts < ActiveRecord::Migration
|
||||
def self.up
|
||||
end
|
||||
|
||||
def self.down
|
||||
end
|
||||
end
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
class CreatePhonesForContacts < ActiveRecord::Migration
|
||||
def self.up
|
||||
end
|
||||
|
||||
def self.down
|
||||
end
|
||||
end
|
||||
19
db/migrate/20110504201530_create_contacts.rb
Normal file
19
db/migrate/20110504201530_create_contacts.rb
Normal 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
|
||||
14
db/migrate/20110504201805_create_mails.rb
Normal file
14
db/migrate/20110504201805_create_mails.rb
Normal 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
|
||||
14
db/migrate/20110504202804_create_phones.rb
Normal file
14
db/migrate/20110504202804_create_phones.rb
Normal 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
|
||||
56
db/schema.rb
56
db/schema.rb
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue