<?php

class m150320_095247_create_plate_auth_insert_profile_table extends MyDbMigration
{
  public function up()
  {
    $this->createTableIfNotExists('plate_auth_insert_profile');
    $this->addColumn('plate_auth_insert_profile','list_code','int NOT NULL DEFAULT -1');
    $this->addColumn('plate_auth_insert_profile','name','string NOT NULL');
    $this->addColumn('plate_auth_insert_profile','description','string');
    
    $this->createTableIfNotExists('plate_auth_insert_profile_field');
    $this->addColumn('plate_auth_insert_profile_field','profile','int(10) unsigned NOT NULL');
    $this->addColumn('plate_auth_insert_profile_field','group','string NOT NULL DEFAULT \'\'');
    $this->addColumn('plate_auth_insert_profile_field','name','string NOT NULL');
    $this->addColumn('plate_auth_insert_profile_field','label','string NOT NULL');
    $this->addColumn('plate_auth_insert_profile_field','description','string');
    $this->addColumn('plate_auth_insert_profile_field','type','string NOT NULL');
    $this->addColumn('plate_auth_insert_profile_field','required','boolean NOT NULL');
    $this->addColumn('plate_auth_insert_profile_field','visible','boolean NOT NULL');
    $this->addColumn('plate_auth_insert_profile_field','editable','boolean NOT NULL');
    $this->addColumn('plate_auth_insert_profile_field','default','string');
    $this->addColumn('plate_auth_insert_profile_field','values','string');
    $this->addColumn('plate_auth_insert_profile_field','order','INTEGER NOT NULL DEFAULT 0');
    $this->addColumn('plate_auth_insert_profile_field','column','INTEGER NOT NULL DEFAULT 0');
    $this->addColumn('plate_auth_insert_profile_field','comment','string');
    
  }

  public function down()
  {
    $this->dropTableIfExists('plate_auth_insert_profile_field');
    $this->dropTableIfExists('plate_auth_insert_profile');
    return true;
  }
}
