foreman/db/migrate/20090730152224_create_ptables.rb @ 8a65dff7
9a55cdc2 | Ohad Levy | class CreatePtables < ActiveRecord::Migration
|
|
def self.up
|
|||
create_table :ptables do |t|
|
|||
t.string :name, :limit => 64, :null => false
|
|||
t.string :layout, :limit => 4096, :null => false
|
|||
c6eee281 | Ohad Levy | t.references :operatingsystem
|
|
9a55cdc2 | Ohad Levy | t.timestamps
|
|
end
|
|||
f76a77e7 | Ohad Levy | Ptable.create :name => "RedHat default", :layout =>"zerombr yes\nclearpart --all --initlabel\npart /boot --fstype ext3 --size=100 --asprimary\npart / --fstype ext3 --size=1024 --grow\npart swap --recommended"
|
|
Ptable.create :name => "Ubuntu default", :layout =>"d-i partman-auto/disk string /dev/sda\nd-i partman-auto/method string regular\nd-i partman-auto/init_automatically_partition select Guided - use entire disk\nd-i partman/confirm_write_new_label boolean true\nd-i partman/choose_partition select \\\nFinish partitioning and write changes to disk\nd-i partman/confirm boolean true\n"
|
|||
c6eee281 | Ohad Levy | ||
create_table :operatingsystems_ptables, :id => false do |t|
|
|||
t.references :ptable, :null => false
|
|||
t.references :operatingsystem, :null => false
|
|||
end
|
|||
9a55cdc2 | Ohad Levy | end
|
|
def self.down
|
|||
drop_table :ptables
|
|||
c6eee281 | Ohad Levy | drop_table :operatingsystems_ptables
|
|
9a55cdc2 | Ohad Levy | end
|
|
end
|