Package er.attachment.migrations

Source Code of er.attachment.migrations.ERAttachment2

package er.attachment.migrations;

import com.webobjects.eocontrol.EOEditingContext;

import er.extensions.migration.ERXMigrationDatabase;
import er.extensions.migration.ERXMigrationTable;

public class ERAttachment2 extends
                          ERXMigrationDatabase.Migration {

  private static final String ER_ATTACHMENT_TABLE_NAME = "ERAttachment";
  private static final String CF_PATH_COLUMN_NAME = "cfPath";


  @Override
    public void downgrade(EOEditingContext editingContext,
                          ERXMigrationDatabase database) throws Throwable {
    ERXMigrationTable attachmentTable = database.existingTableNamed(ERAttachment2.ER_ATTACHMENT_TABLE_NAME);
    attachmentTable.existingColumnNamed(CF_PATH_COLUMN_NAME).delete();
     
    }


  @Override
  public void upgrade(EOEditingContext editingContext,
                      ERXMigrationDatabase database) throws Throwable {
    ERXMigrationTable attachmentTable = database.existingTableNamed(ERAttachment2.ER_ATTACHMENT_TABLE_NAME);
    attachmentTable.newStringColumn(CF_PATH_COLUMN_NAME, 1000, true);

  }

}
TOP

Related Classes of er.attachment.migrations.ERAttachment2

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.