Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

SQLiteBuilder.php 1.3KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <?php
  2. namespace Illuminate\Database\Schema;
  3. class SQLiteBuilder extends Builder
  4. {
  5. /**
  6. * Drop all tables from the database.
  7. *
  8. * @return void
  9. */
  10. public function dropAllTables()
  11. {
  12. if ($this->connection->getDatabaseName() !== ':memory:') {
  13. return $this->refreshDatabaseFile();
  14. }
  15. $this->connection->select($this->grammar->compileEnableWriteableSchema());
  16. $this->connection->select($this->grammar->compileDropAllTables());
  17. $this->connection->select($this->grammar->compileDisableWriteableSchema());
  18. $this->connection->select($this->grammar->compileRebuild());
  19. }
  20. /**
  21. * Drop all views from the database.
  22. *
  23. * @return void
  24. */
  25. public function dropAllViews()
  26. {
  27. $this->connection->select($this->grammar->compileEnableWriteableSchema());
  28. $this->connection->select($this->grammar->compileDropAllViews());
  29. $this->connection->select($this->grammar->compileDisableWriteableSchema());
  30. $this->connection->select($this->grammar->compileRebuild());
  31. }
  32. /**
  33. * Empty the database file.
  34. *
  35. * @return void
  36. */
  37. public function refreshDatabaseFile()
  38. {
  39. file_put_contents($this->connection->getDatabaseName(), '');
  40. }
  41. }