View file visavi-rotorcms-63832fa/app/database/migrations/20151214202936_add_fk_to_bookmarks.php

File size: 411B
<?php

use Phinx\Migration\AbstractMigration;

class AddFkToBookmarks extends AbstractMigration
{
	/**
	 * Change Method.
	 */
	public function change()
	{
		$table = $this->table('bookmarks');
		$table->addForeignKey('topic_id', 'topics', 'id',
			['delete'=> 'cascade', 'update' => 'restrict'])
		->addForeignKey('user_id', 'users', 'id',
			['delete'=> 'cascade', 'update' => 'restrict'])
		->update();
	}
}