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
962ecab7
Commit
962ecab7
authored
Feb 10, 2010
by
beberlei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[2.0] DDC-312 - Prepared View and Trigger support in DBAL\Schema
parent
22edbcec
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
11 additions
and
19 deletions
+11
-19
AbstractSchemaManager.php
lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php
+1
-1
Schema.php
lib/Doctrine/DBAL/Schema/Schema.php
+3
-1
SchemaTool.php
lib/Doctrine/ORM/Tools/SchemaTool.php
+1
-1
OracleSchemaManagerTest.php
.../Tests/DBAL/Functional/Schema/OracleSchemaManagerTest.php
+0
-10
ComparatorTest.php
tests/Doctrine/Tests/DBAL/Schema/ComparatorTest.php
+4
-4
SchemaTest.php
tests/Doctrine/Tests/DBAL/Schema/SchemaTest.php
+2
-2
No files found.
lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php
View file @
962ecab7
...
...
@@ -806,7 +806,7 @@ abstract class AbstractSchemaManager
}
$tables
=
$this
->
listTables
();
return
new
Schema
(
$tables
,
$sequences
,
$this
->
createSchemaConfig
());
return
new
Schema
(
$tables
,
$sequences
,
array
(),
array
(),
$this
->
createSchemaConfig
());
}
/**
...
...
lib/Doctrine/DBAL/Schema/Schema.php
View file @
962ecab7
...
...
@@ -54,9 +54,11 @@ class Schema extends AbstractAsset
/**
* @param array $tables
* @param array $sequences
* @param array $views
* @param array $triggers
* @param SchemaConfig $schemaConfig
*/
public
function
__construct
(
array
$tables
=
array
(),
array
$sequences
=
array
(),
SchemaConfig
$schemaConfig
=
null
)
public
function
__construct
(
array
$tables
=
array
(),
array
$sequences
=
array
(),
array
$views
=
array
(),
array
$triggers
=
array
(),
SchemaConfig
$schemaConfig
=
null
)
{
if
(
$schemaConfig
==
null
)
{
$schemaConfig
=
new
SchemaConfig
();
...
...
lib/Doctrine/ORM/Tools/SchemaTool.php
View file @
962ecab7
...
...
@@ -114,7 +114,7 @@ class SchemaTool
$metadataSchemaConfig
->
setMaxIdentifierLength
(
63
);
$sm
=
$this
->
_em
->
getConnection
()
->
getSchemaManager
();
$schema
=
new
\Doctrine\DBAL\Schema\Schema
(
array
(),
array
(),
$metadataSchemaConfig
);
$schema
=
new
\Doctrine\DBAL\Schema\Schema
(
array
(),
array
(),
array
(),
array
(),
$metadataSchemaConfig
);
foreach
(
$classes
as
$class
)
{
if
(
isset
(
$processedClasses
[
$class
->
name
])
||
$class
->
isMappedSuperclass
)
{
...
...
tests/Doctrine/Tests/DBAL/Functional/Schema/OracleSchemaManagerTest.php
View file @
962ecab7
...
...
@@ -47,16 +47,6 @@ class OracleSchemaManagerTest extends SchemaManagerFunctionalTestCase
$this
->
assertEquals
(
true
,
$found
);
}
public
function
testListViews
()
{
$this
->
_sm
->
dropAndCreateView
(
'test_create_view'
,
'SELECT * FROM sys.user_tables'
);
$views
=
$this
->
_sm
->
listViews
();
$view
=
end
(
$views
);
$this
->
assertEquals
(
'TEST_CREATE_VIEW'
,
$view
[
'name'
]);
}
public
function
testRenameTable
()
{
$this
->
_sm
->
tryMethod
(
'DropTable'
,
'list_tables_test'
);
...
...
tests/Doctrine/Tests/DBAL/Schema/ComparatorTest.php
View file @
962ecab7
...
...
@@ -91,8 +91,8 @@ class ComparatorTest extends \PHPUnit_Framework_TestCase
$table
=
new
Table
(
'bugdb'
,
array
(
'integerfield1'
=>
new
Column
(
'integerfield1'
,
Type
::
getType
(
'integer'
))));
$table
->
setSchemaConfig
(
$schemaConfig
);
$schema1
=
new
Schema
(
array
(
$table
),
array
(),
$schemaConfig
);
$schema2
=
new
Schema
(
array
(),
array
(),
$schemaConfig
);
$schema1
=
new
Schema
(
array
(
$table
),
array
(),
array
(),
array
(),
$schemaConfig
);
$schema2
=
new
Schema
(
array
(),
array
(),
array
(),
array
(),
$schemaConfig
);
$expected
=
new
SchemaDiff
(
array
(),
array
(),
array
(
'bugdb'
=>
$table
)
);
...
...
@@ -105,8 +105,8 @@ class ComparatorTest extends \PHPUnit_Framework_TestCase
$table
=
new
Table
(
'bugdb'
,
array
(
'integerfield1'
=>
new
Column
(
'integerfield1'
,
Type
::
getType
(
'integer'
))));
$table
->
setSchemaConfig
(
$schemaConfig
);
$schema1
=
new
Schema
(
array
(),
array
(),
$schemaConfig
);
$schema2
=
new
Schema
(
array
(
$table
),
array
(),
$schemaConfig
);
$schema1
=
new
Schema
(
array
(),
array
(),
array
(),
array
(),
$schemaConfig
);
$schema2
=
new
Schema
(
array
(
$table
),
array
(),
array
(),
array
(),
$schemaConfig
);
$expected
=
new
SchemaDiff
(
array
(
'bugdb'
=>
$table
),
array
(),
array
()
);
$this
->
assertEquals
(
$expected
,
Comparator
::
compareSchemas
(
$schema1
,
$schema2
)
);
...
...
tests/Doctrine/Tests/DBAL/Schema/SchemaTest.php
View file @
962ecab7
...
...
@@ -193,7 +193,7 @@ class SchemaTest extends \PHPUnit_Framework_TestCase
$schemaConfig
=
new
\Doctrine\DBAL\Schema\SchemaConfig
();
$schemaConfig
->
setExplicitForeignKeyIndexes
(
false
);
$schema
=
new
Schema
(
array
(),
array
(),
$schemaConfig
);
$schema
=
new
Schema
(
array
(),
array
(),
array
(),
array
(),
$schemaConfig
);
$this
->
assertFalse
(
$schema
->
hasExplicitForeignKeyIndexes
());
$schemaConfig
->
setExplicitForeignKeyIndexes
(
true
);
...
...
@@ -205,7 +205,7 @@ class SchemaTest extends \PHPUnit_Framework_TestCase
$schemaConfig
=
new
\Doctrine\DBAL\Schema\SchemaConfig
();
$schemaConfig
->
setMaxIdentifierLength
(
10
);
$schema
=
new
Schema
(
array
(),
array
(),
$schemaConfig
);
$schema
=
new
Schema
(
array
(),
array
(),
array
(),
array
(),
$schemaConfig
);
$table
=
$schema
->
createTable
(
"smalltable"
);
$table
->
createColumn
(
'long_id'
,
'integer'
);
$table
->
addIndex
(
array
(
'long_id'
));
...
...
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