/** * @return Schema */ public function build() : Schema { $schema = new Schema($this->name); foreach ($this->types as $type) { $schema->add($type); } return $schema; }
public function test_alter_existing_table() { $foo = new TypeSchema('foo', ['id' => new TextField(), 'foo' => new TextField()]); $fooSchema = new Schema('test'); $fooSchema->add($foo); $bar = new TypeSchema('foo', ['id' => new TextField(), 'bar' => new TextField()]); $barSchema = new Schema('test'); $barSchema->add($bar); $this->storage->create($fooSchema); $this->storage->alter($barSchema); $result = $this->connection->getSchemaManager()->listTableColumns('metadata_test_foo'); $this->assertArrayHasKey('bar', $result); }