m160108_095739_create_news_table.php 610 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. use yii\db\Schema;
  3. use yii\db\Migration;
  4. class m160108_095739_create_news_table extends Migration
  5. {
  6. public function up()
  7. {
  8. $sql = file_get_contents(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'sql' . DIRECTORY_SEPARATOR . $this->className() . '.sql');
  9. $this->execute($sql);
  10. }
  11. public function down()
  12. {
  13. echo "m160108_095739_create_news_table cannot be reverted.\n";
  14. return false;
  15. }
  16. /*
  17. // Use safeUp/safeDown to run migration code within a transaction
  18. public function safeUp()
  19. {
  20. }
  21. public function safeDown()
  22. {
  23. }
  24. */
  25. }