Guest User

Untitled

a guest
Jun 19th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.13 KB | None | 0 0
  1. <?php
  2.  
  3. class ResizeUserColumns extends Doctrine_Migration_Base
  4. {
  5. public function up()
  6. {
  7. $this->changeColumn('users', 'username', 'string', array(
  8. 'length' => 50,
  9. 'notnull' => true
  10. ));
  11. $this->changeColumn('users', 'firstname', 'string', array(
  12. 'length' => 32,
  13. 'notnull' => true
  14. ));
  15. $this->changeColumn('users', 'lastname', 'string', array(
  16. 'length' => 32,
  17. 'notnull' => true
  18. ));
  19. $this->changeColumn('users', 'pager', 'string', array(
  20. 'length' => 40,
  21. 'notnull' => true,
  22. 'default' => ''
  23. ));
  24. $this->changeColumn('users', 'pda', 'string', array(
  25. 'length' => 36,
  26. 'notnull' => true,
  27. 'default' => ''
  28. ));
  29. $this->changeColumn('users', 'externalkey', 'string', array(
  30. 'length' => 16,
  31. 'notnull' => true,
  32. 'default' => ''
  33. ));
  34. $this->removeColumn('users', 'old_password');
  35. }
  36.  
  37. public function down()
  38. {
  39. $this->changeColumn('users', 'username', 'string', array(
  40. 'length' => 255,
  41. 'notnull' => true
  42. ));
  43. $this->changeColumn('users', 'firstname', 'string', array(
  44. 'length' => 255,
  45. 'notnull' => true
  46. ));
  47. $this->changeColumn('users', 'lastname', 'string', array(
  48. 'length' => 255,
  49. 'notnull' => true
  50. ));
  51. $this->changeColumn('users', 'pager', 'string', array(
  52. 'length' => 255,
  53. 'notnull' => true,
  54. 'default' => ''
  55. ));
  56. $this->changeColumn('users', 'pda', 'string', array(
  57. 'length' => 255,
  58. 'notnull' => true,
  59. 'default' => ''
  60. ));
  61. $this->changeColumn('users', 'externalkey', 'string', array(
  62. 'length' => 255,
  63. 'notnull' => true,
  64. 'default' => ''
  65. ));
  66. $this->addColumn('users', 'old_password', 'string', array(
  67. 'length' => 32
  68. ));
  69. }
  70. }
Add Comment
Please, Sign In to add comment