Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Example Init Code #280

Merged
merged 2 commits into from
Dec 17, 2014
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions examples/relational/config/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
print 'Creating sessions table'.PHP_EOL;

Capsule::schema()->create('oauth_sessions', function ($table) {
$table->increments('id');
$table->increments('id')->unsigned();
$table->string('owner_type');
$table->string('owner_id');
$table->string('client_id');
Expand Down Expand Up @@ -135,7 +135,7 @@

Capsule::schema()->create('oauth_access_tokens', function ($table) {
$table->string('access_token')->primary();
$table->integer('session_id');
$table->integer('session_id')->unsigned();
$table->integer('expire_time');

$table->foreign('session_id')->references('id')->on('oauth_sessions')->onDelete('cascade');
Expand Down Expand Up @@ -168,7 +168,7 @@
$table->integer('expire_time');
$table->string('access_token');

$table->foreign('access_token')->references('id')->on('oauth_access_tokens')->onDelete('cascade');
$table->foreign('access_token')->references('access_token')->on('oauth_access_tokens')->onDelete('cascade');
});

/******************************************************************************/
Expand All @@ -177,7 +177,7 @@

Capsule::schema()->create('oauth_auth_codes', function ($table) {
$table->string('auth_code')->primary();
$table->integer('session_id');
$table->integer('session_id')->unsigned();
$table->integer('expire_time');
$table->string('client_redirect_uri');

Expand All @@ -189,7 +189,7 @@
print 'Creating oauth access token scopes table'.PHP_EOL;

Capsule::schema()->create('oauth_access_token_scopes', function ($table) {
$table->increments('id');
$table->increments('id')->unsigned();
$table->string('access_token');
$table->string('scope');

Expand Down Expand Up @@ -240,8 +240,8 @@
print 'Creating oauth session scopes table'.PHP_EOL;

Capsule::schema()->create('oauth_session_scopes', function ($table) {
$table->increments('id');
$table->string('session_id');
$table->increments('id')->unsigned();
$table->string('session_id')->unsigned();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've just noticed that session_id should be an integer, could you change that too please?

$table->string('scope');

$table->foreign('session_id')->references('id')->on('oauth_sessions')->onDelete('cascade');
Expand Down