Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

MigrationInterface.php 1.2KB

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. /**
  3. * @link http://www.yiiframework.com/
  4. * @copyright Copyright (c) 2008 Yii Software LLC
  5. * @license http://www.yiiframework.com/license/
  6. */
  7. namespace yii\db;
  8. /**
  9. * The MigrationInterface defines the minimum set of methods to be implemented by a database migration.
  10. *
  11. * Each migration class should provide the [[up()]] method containing the logic for "upgrading" the database
  12. * and the [[down()]] method for the "downgrading" logic.
  13. *
  14. * @author Klimov Paul <klimov@zfort.com>
  15. * @since 2.0
  16. */
  17. interface MigrationInterface
  18. {
  19. /**
  20. * This method contains the logic to be executed when applying this migration.
  21. * @return boolean return a false value to indicate the migration fails
  22. * and should not proceed further. All other return values mean the migration succeeds.
  23. */
  24. public function up();
  25. /**
  26. * This method contains the logic to be executed when removing this migration.
  27. * The default implementation throws an exception indicating the migration cannot be removed.
  28. * @return boolean return a false value to indicate the migration fails
  29. * and should not proceed further. All other return values mean the migration succeeds.
  30. */
  31. public function down();
  32. }