SchemaSynchronizer.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?php
  2. namespace Doctrine\DBAL\Schema\Synchronizer;
  3. use Doctrine\DBAL\Schema\Schema;
  4. /**
  5. * The synchronizer knows how to synchronize a schema with the configured
  6. * database.
  7. */
  8. interface SchemaSynchronizer
  9. {
  10. /**
  11. * Gets the SQL statements that can be executed to create the schema.
  12. *
  13. * @return string[]
  14. */
  15. public function getCreateSchema(Schema $createSchema);
  16. /**
  17. * Gets the SQL Statements to update given schema with the underlying db.
  18. *
  19. * @param bool $noDrops
  20. *
  21. * @return string[]
  22. */
  23. public function getUpdateSchema(Schema $toSchema, $noDrops = false);
  24. /**
  25. * Gets the SQL Statements to drop the given schema from underlying db.
  26. *
  27. * @return string[]
  28. */
  29. public function getDropSchema(Schema $dropSchema);
  30. /**
  31. * Gets the SQL statements to drop all schema assets from underlying db.
  32. *
  33. * @return string[]
  34. */
  35. public function getDropAllSchema();
  36. /**
  37. * Creates the Schema.
  38. *
  39. * @return void
  40. */
  41. public function createSchema(Schema $createSchema);
  42. /**
  43. * Updates the Schema to new schema version.
  44. *
  45. * @param bool $noDrops
  46. *
  47. * @return void
  48. */
  49. public function updateSchema(Schema $toSchema, $noDrops = false);
  50. /**
  51. * Drops the given database schema from the underlying db.
  52. *
  53. * @return void
  54. */
  55. public function dropSchema(Schema $dropSchema);
  56. /**
  57. * Drops all assets from the underlying db.
  58. *
  59. * @return void
  60. */
  61. public function dropAllSchema();
  62. }