Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
doctrine-dbal
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tomáš Trávníček
doctrine-dbal
Commits
61274843
Commit
61274843
authored
Oct 15, 2007
by
samw3
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Testing migration addColumn
parent
09f08242
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
13 deletions
+17
-13
MigrationTestCase.php
tests/MigrationTestCase.php
+4
-1
001_add_table.php
tests/migration_classes/001_add_table.php
+13
-12
No files found.
tests/MigrationTestCase.php
View file @
61274843
...
...
@@ -37,8 +37,11 @@ class Doctrine_Migration_TestCase extends Doctrine_UnitTestCase
// New migration for the 'migration_classes' directory
$migration
=
new
Doctrine_Migration
(
'migration_classes'
);
// migrate to version
2
// migrate to version
3
$migration
->
migrate
(
2
);
// Make sure the column was added
$this
->
assertTrue
(
Doctrine_Manager
::
getInstance
()
->
getTable
(
'User'
)
->
hasColumn
(
'field2'
));
// now migrate back to original version
$migration
->
migrate
(
0
);
...
...
tests/migration_classes/001_add_table.php
View file @
61274843
<?php
class
AddTable
extends
Doctrine_Migration
{
public
function
up
()
{
$this
->
createTable
(
'migration_test'
,
array
(
'field1'
=>
array
(
'type'
=>
'string'
)));
}
public
function
down
()
{
$this
->
dropTable
(
'migration_test'
);
}
<?php
class
AddTable
extends
Doctrine_Migration
{
public
function
up
()
{
$this
->
createTable
(
'migration_test'
,
array
(
'field1'
=>
array
(
'type'
=>
'string'
)));
$this
->
addColumn
(
'migration_test'
,
'field2'
,
'integer'
);
}
public
function
down
()
{
$this
->
dropTable
(
'migration_test'
);
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment