forked from phalcon/phalcon-devtools
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request phalcon#1161 from phalcon/3.2.x
3.2.x
- Loading branch information
Showing
13 changed files
with
123 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
tests/_data/console_data/run_mysql_migration/1.0.2/test_migrations.dat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1,test1,"2017-08-29 13:05:41","2017-08-29 13:05:41" |
100 changes: 100 additions & 0 deletions
100
tests/_data/console_data/run_mysql_migration/1.0.2/test_migrations.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
<?php | ||
|
||
use Phalcon\Db\Column; | ||
use Phalcon\Db\Index; | ||
use Phalcon\Db\Reference; | ||
use Phalcon\Mvc\Model\Migration; | ||
|
||
/** | ||
* Class TestMigrationsMigration_101 | ||
*/ | ||
class TestMigrationsMigration_102 extends Migration | ||
{ | ||
/** | ||
* Define the table structure | ||
* | ||
* @return void | ||
*/ | ||
public function morph() | ||
{ | ||
$this->morphTable('test_migrations', [ | ||
'columns' => [ | ||
new Column( | ||
'id', | ||
[ | ||
'type' => Column::TYPE_INTEGER, | ||
'unsigned' => true, | ||
'notNull' => true, | ||
'autoIncrement' => true, | ||
'size' => 10, | ||
'first' => true | ||
] | ||
), | ||
new Column( | ||
'name', | ||
[ | ||
'type' => Column::TYPE_VARCHAR, | ||
'notNull' => true, | ||
'size' => 45, | ||
'after' => 'id' | ||
] | ||
), | ||
new Column( | ||
'created_at', | ||
[ | ||
'type' => Column::TYPE_DATETIME, | ||
'notNull' => true, | ||
'size' => 1, | ||
'after' => 'name' | ||
] | ||
), | ||
new Column( | ||
'updated_at', | ||
[ | ||
'type' => Column::TYPE_DATETIME, | ||
'notNull' => true, | ||
'size' => 1, | ||
'after' => 'created_at' | ||
] | ||
) | ||
], | ||
'indexes' => [ | ||
new Index('PRIMARY', ['id'], 'PRIMARY') | ||
], | ||
'options' => [ | ||
'TABLE_TYPE' => 'BASE TABLE', | ||
'AUTO_INCREMENT' => '2', | ||
'ENGINE' => 'InnoDB', | ||
'TABLE_COLLATION' => 'utf8_general_ci' | ||
], | ||
] | ||
); | ||
} | ||
|
||
/** | ||
* Run the migrations | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
$this->batchInsert('test_migrations', [ | ||
'id', | ||
'name', | ||
'created_at', | ||
'updated_at' | ||
] | ||
); | ||
} | ||
|
||
/** | ||
* Reverse the migrations | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
$this->batchDelete('test_migrations'); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters