public function create(Schema $schema)
{
$currentDbSchema = $this->connection->getSchemaManager()->createSchema();
$dbSchema = new DBALSchema($currentDbSchema->getTables(), $currentDbSchema->getSequences(), $this->connection->getSchemaManager()->createSchemaConfig());
foreach ($schema->types() as $type) {
$tableName = $this->tableName($schema->name(), $type->name());
if ($dbSchema->hasTable($tableName)) {
throw DoctrineStorageException::tableAlreadyExists($tableName);
}
$this->createTable($dbSchema, $schema->name(), $type);
}
$queries = $dbSchema->toSql($this->connection->getDatabasePlatform());
$this->executeQueries($queries);
}
public function test_delete() { $uuid = (string) Uuid::uuid4(); $this->storage->create($this->schema); $this->storage->save('test', 'foo', $uuid, ['text' => 'value']); $this->storage->delete('test', 'foo', $uuid); $this->assertFalse($this->storage->has('test', 'foo', $uuid)); }