1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- <?php
- use yii\db\Migration;
- /**
- * Class m240717_221515_tablas_taller_vehiculo
- */
- class m240717_221515_tablas_taller_vehiculo extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp() {
- $this->createTable('Taller', [
- "id" => $this->string(36),
- "nombre" => $this->string(100)->notNull(),
- "direccion" => $this->string(100)->notNull(),
- "mecanico" => $this->string(100)->notNull(),
- "descripcion" => $this->text(),
- "telefono" => $this->string(10),
- "creado" => $this->timestamp()->append(" with time zone"),
- "modificado" => $this->timestamp()->append(" with time zone"),
- "eliminado" => $this->timestamp()->append(" with time zone"),
- ]);
-
- $this->addPrimaryKey("TallerPK", "Taller", "id");
-
- $this->createTable('Vehiculo', [
- "id" => $this->string(36),
- "nombre" => $this->string(100),
- "ano" => $this->integer(4),
- "color" => $this->string(100),
- "placa" => $this->string(100),
- "serie" => $this->string(100),
- "creado" => $this->timestamp()->append(" with time zone"),
- "modificado" => $this->timestamp()->append(" with time zone"),
- "eliminado" => $this->timestamp()->append(" with time zone"),
- ]);
-
- $this->addPrimaryKey("VehiculoPK", "Vehiculo", "id");
-
- }
-
- /**
- * {@inheritdoc}
- */
- public function safeDown() {
- $this->dropTable('Vehiculo');
- $this->dropTable('Taller');
- }
- }
|