Skip to content

Commit 585059a

Browse files
authored
Merge pull request #57 from drewroberts/drewroberts/feature/56-webpages
Update Migrations with Webpage #56
2 parents 13fb7b8 + d2b68d4 commit 585059a

4 files changed

+20
-12
lines changed

Diff for: database/migrations/2017_05_20_100000_create_topics_table.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@ public function up()
1414
$table->string('title')->unique();
1515
$table->string('note')->nullable(); // Just for internal reference purposes only, not displayed on website.
1616
$table->text('content')->nullable(); // Will be written in Markdown.
17+
18+
$table->foreignIdFor(app('webpage'))->nullable(); // Used to track seo rankings
19+
$table->unsignedInteger('pageviews')->index(); // Total current pageviews for topic page. Will be synced from Google Analytics API.
20+
1721
$table->string('description')->nullable(); // Primary description used for SEO.
1822
$table->string('ogdescription')->nullable(); // Open Graph Description used for social shares. Will default to description if NULL.
19-
$table->unsignedInteger('pageviews')->index(); // Total current pageviews for topic page. Will be synced from Google Analytics API.
20-
2123
$table->foreignIdFor(app('image'))->nullable(); // Cover image for topic
2224
$table->foreignIdFor(app('image'), 'ogimage_id')->nullable(); // External open graph image id. Featured image for social sharing. Will default to image_id unless this is used. Allows override for play button or words on image.
2325
$table->foreignIdFor(app('video'))->nullable(); // If topic has a featured video.

Diff for: database/migrations/2017_05_20_110000_create_series_table.php

+5-3
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,17 @@ public function up()
1010
{
1111
Schema::create('series', function (Blueprint $table) {
1212
$table->id();
13+
$table->foreignIdFor(app('topic')); // Group series into larger topics
1314
$table->string('slug')->unique()->index();
1415
$table->string('title')->unique();
1516
$table->string('note')->nullable(); // Just for internal reference purposes only, not displayed on website.
1617
$table->text('content')->nullable(); // Will be written in Markdown.
17-
$table->string('description')->nullable(); // Primary description used for SEO.
18-
$table->string('ogdescription')->nullable(); // Open Graph Description used for social shares. Will default to description if NULL.
18+
19+
$table->foreignIdFor(app('webpage'))->nullable(); // Used to track seo rankings
1920
$table->unsignedInteger('pageviews')->index(); // Total current pageviews for series page. Will be synced from Google Analytics API.
2021

21-
$table->foreignIdFor(app('topic')); // Group series into larger topics
22+
$table->string('description')->nullable(); // Primary description used for SEO.
23+
$table->string('ogdescription')->nullable(); // Open Graph Description used for social shares. Will default to description if NULL.
2224
$table->foreignIdFor(app('image'))->nullable(); // Cover image for series
2325
$table->foreignIdFor(app('image'), 'ogimage_id')->nullable(); // External open graph image id. Featured image for social sharing. Will default to image_id unless this is used. Allows override for play button or words on image.
2426
$table->foreignIdFor(app('video'))->nullable(); // If series has a featured video.

Diff for: database/migrations/2017_05_20_120000_create_posts_table.php

+6-4
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,15 @@ public function up()
1212
$table->id();
1313
$table->string('slug')->unique()->index();
1414
$table->string('title')->unique();
15+
$table->foreignIdFor(app('topic'))->nullable(); // Group blog posts into topics
16+
$table->foreignIdFor(app('series'))->nullable(); // Group blog posts into series
1517
$table->text('content')->nullable(); // Will be written in Markdown.
16-
$table->string('description')->nullable(); // Primary description used for SEO.
17-
$table->string('ogdescription')->nullable(); // Open Graph Description used for social shares. Will default to description if NULL.
18+
19+
$table->foreignIdFor(app('webpage'))->nullable(); // Used to track seo rankings
1820
$table->unsignedInteger('pageviews')->index(); // Total current pageviews for post. Will be synced from Google Analytics API.
1921

20-
$table->foreignIdFor(app('topic'))->nullable(); // Group blog posts into topics
21-
$table->foreignIdFor(app('series'))->nullable(); // Group blog posts into series
22+
$table->string('description')->nullable(); // Primary description used for SEO.
23+
$table->string('ogdescription')->nullable(); // Open Graph Description used for social shares. Will default to description if NULL.
2224
$table->foreignIdFor(app('image'))->nullable(); // Cover image for blog post
2325
$table->foreignIdFor(app('image'), 'ogimage_id')->nullable(); // External open graph image id. Featured image for social sharing. Will default to image_id unless this is used. Allows override for play button or words on image.
2426
$table->foreignIdFor(app('video'))->nullable(); // If blog post has a featured video.

Diff for: database/migrations/2017_05_20_130000_create_pages_table.php

+5-3
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,14 @@ public function up()
1212
$table->id();
1313
$table->string('slug')->unique()->index();
1414
$table->string('title')->unique();
15+
$table->foreignIdFor(app('page'), 'parent_id')->nullable(); // Parent Page
1516
$table->text('content')->nullable(); // Will be written in Markdown.
16-
$table->string('description')->nullable(); // Primary description used for SEO.
17-
$table->string('ogdescription')->nullable(); // Open Graph Description used for social shares. Will default to description if NULL.
17+
18+
$table->foreignIdFor(app('webpage'))->nullable(); // Used to track seo rankings
1819
$table->unsignedInteger('pageviews')->index(); // Total current pageviews for page. Will be synced from Google Analytics API.
1920

20-
$table->foreignIdFor(app('page'), 'parent_id')->nullable(); // Parent Page
21+
$table->string('description')->nullable(); // Primary description used for SEO.
22+
$table->string('ogdescription')->nullable(); // Open Graph Description used for social shares. Will default to description if NULL.
2123
$table->foreignIdFor(app('image'))->nullable(); // Cover image for page
2224
$table->foreignIdFor(app('image'), 'ogimage_id')->nullable(); // External open graph image id. Featured image for social sharing. Will default to image_id unless this is used. Allows override for play button or words on image.
2325
$table->foreignIdFor(app('video'))->nullable(); // If page has a featured video.

0 commit comments

Comments
 (0)