Guest User

Untitled

a guest
Oct 21st, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. <?php
  2.  
  3. namespace Fuel\Migrations;
  4.  
  5. class Add_foreignkey_following
  6. {
  7. public function up()
  8. {
  9. \DBUtil::add_foreign_key('following', array(
  10. 'key' => 'user_id',
  11. 'reference' => array(
  12. 'table' => 'user',
  13. 'column' => 'id',
  14. )
  15. ));
  16. \DBUtil::add_foreign_key('following', array(
  17. 'key' => 'following_id',
  18. 'reference' => array(
  19. 'table' => 'user',
  20. 'column' => 'id',
  21. )
  22. ));
  23. }
  24.  
  25. public function down()
  26. {
  27. \DBUtil::foreign_key('following','user_id');
  28. \DBUtil::foreign_key('following','following_id');
  29. }
  30. }
Add Comment
Please, Sign In to add comment