62 foreach ($schemaArray as
$type => $entity) {
72 return new Schema($tables, $sequences);
85 foreach ($tableArray as
$name => $tabledef) {
88 $tableName = $this->xPrefix .
$name;
91 $fkConstraints = array();
94 foreach ($tabledef[
'columns'] as $colName => $colOptions) {
95 $colType = \Doctrine\DBAL\Types\Type::getType($colOptions[
'type']);
96 unset($colOptions[
'type']);
97 $columns[] =
new Column($colName, $colType, $colOptions);
100 if (isset($tabledef[
'indexes'])) {
101 foreach ($tabledef[
'indexes'] as $indexName => $indexDef) {
102 $indexes[] =
new Index(
104 $indexDef[
'columns'],
111 if (isset($tabledef[
'constraint'])) {
112 foreach ($tabledef[
'constraint'] as $constraintDef) {
113 $fkConstraints[] =
new ForeignKeyConstraint(
114 $constraintDef[
'localcolumns'],
115 $constraintDef[
'foreigntable'],
116 $constraintDef[
'foreigncolumns'],
117 $constraintDef[
'name'] = null,
118 $constraintDef[
'options']
123 if (isset($tabledef[
'options']))
125 $tables[] =
new Table(
146 $sequences = array();
148 foreach ($sequenceArray as
$name => $sequenceDef) {
151 $sequences[] =
new Sequence(
152 $sequenceDef[
'name'],
153 $sequenceDef[
'allocationsize'],
154 $sequenceDef[
'initialvalue']
importSequences(array $sequenceArray)
importTables(array $tableArray)
importSchemaArray(array $schemaArray)