20210321160400_fix_location_address_allow_null.php 1.3 KB

123456789101112131415161718192021222324252627282930
  1. <?php
  2. use Phinx\Migration\AbstractMigration;
  3. class FixLocationAddressAllowNull extends AbstractMigration {
  4. public function up() {
  5. $this->table("location")
  6. ->changeColumn("legal_entity_name", "string", ["limit" => 50, "null" => true])
  7. ->changeColumn("address_1", "string", ["limit" => 50, "null" => true])
  8. ->changeColumn("address_2", "string", ["limit" => 50, "null" => true])
  9. ->changeColumn("city", "string", ["limit" => 50, "null" => true])
  10. ->changeColumn("county", "string", ["limit" => 50, "null" => true])
  11. ->changeColumn("postal_code", "string", ["limit" => 20, "null" => true])
  12. ->changeColumn("state", "string", ["limit" => 50, "null" => true])
  13. ->changeColumn("country", "string", ["limit" => 50, "null" => true])
  14. ->changeColumn("email", "string", ["limit" => 100, "null" => true])
  15. ->changeColumn("phone", "string", ["limit" => 20, "null" => true])
  16. ->changeColumn("opening_hours", "string", ["limit" => 200, "null" => true])
  17. ->changeColumn("shop_left", "string", ["limit" => 50, "null" => true])
  18. ->changeColumn("shop_right", "string", ["limit" => 50, "null" => true])
  19. ->changeColumn("latitude", "double", ["null" => true])
  20. ->changeColumn("longitude", "double", ["null" => true])
  21. ->changeColumn("dts_verified", "datetime", ["null" => true])
  22. ->update();
  23. }
  24. public function down() {
  25. }
  26. }