CreateTable.php 681 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCP\Migration\Attributes;
  8. use Attribute;
  9. /**
  10. * attribute on table creation
  11. *
  12. * @since 30.0.0
  13. */
  14. #[Attribute(Attribute::IS_REPEATABLE | Attribute::TARGET_CLASS)]
  15. class CreateTable extends TableMigrationAttribute {
  16. /**
  17. * @return string
  18. * @since 30.0.0
  19. */
  20. public function definition(): string {
  21. $definition = 'Creation of new table \'' . $this->getTable() . '\'';
  22. $definition .= empty($this->getColumns()) ? '' : ' with columns ' . implode(', ', $this->getColumns());
  23. return $definition;
  24. }
  25. }