m211215_012217_inicio.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. use yii\db\Migration;
  3. /**
  4. * Class m211215_012217_inicio
  5. */
  6. class m211215_012217_inicio extends Migration {
  7. /**
  8. * {@inheritdoc}
  9. */
  10. public function safeUp() {
  11. $this->createTable("Descarga", [
  12. "id" => $this->primaryKey(),
  13. "hash" => $this->string(32),
  14. "estacion" => $this->string(20),
  15. "archivo" => $this->string(100),
  16. "ciudad" => $this->string(20),
  17. "pc" => $this->string(20),
  18. "fecha" => $this->timestamp(),
  19. "descargado" => $this->boolean()->defaultValue(false),
  20. "nombre" => $this->string(100),
  21. "ruta" => $this->string(100)
  22. ]);
  23. $this->createIndex("DescargaHashIndex", "Descarga", "hash");
  24. $this->createIndex("DescargaEstacionIndex", "Descarga", "estacion");
  25. $this->createIndex("DescargaCiudadIndex", "Descarga", "ciudad");
  26. $this->createIndex("DescargaFechaIndex", "Descarga", "fecha");
  27. $this->createIndex("DescargaPcIndex", "Descarga", "pc");
  28. }
  29. /**
  30. * {@inheritdoc}
  31. */
  32. public function safeDown() {
  33. $this->dropTable("Descarga");
  34. }
  35. }