Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
33 changes: 33 additions & 0 deletions database/migrations/2018_11_17_124956_create_users_table.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateUsersTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up() {
Schema::create('users', function (Blueprint $table) {
$table->increments('id');
$table->string('email')->unique();
$table->string('password');
// remeber_token needed https://stackoverflow.com/questions/24954537/is-it-compulsory-to-use-remember-token-field
$table->string('remember_token', 100)->nullable();
$table->boolean('verified')->default(0);
$table->timestamps();
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down() {
Schema::dropIfExists('users');
}
}
43 changes: 43 additions & 0 deletions database/migrations/2018_11_17_133622_create_wiki_dbs_table.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateWikidbsTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up() {
Schema::create('wiki_dbs', function (Blueprint $table) {
$table->increments('id');

$table->string('name', 100);
$table->string('prefix', 100);
$table->string('user', 100);
$table->string('password', 100);

// Require the dbname and prefix to be unique...
$table->unique(['name', 'prefix']);

$table->string('version', 20);
// Index needed so that we can easily query what needs to be updated
$table->index('version');

$table->integer('wiki_id')->nullable()->unsigned()->unique();

$table->timestamps();
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down() {
Schema::dropIfExists('wiki_dbs');
}
}
33 changes: 33 additions & 0 deletions database/migrations/2018_11_17_133627_create_wikis_table.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateWikisTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up() {
Schema::create('wikis', function (Blueprint $table) {
$table->increments('id');

$table->string('domain')->unique();
$table->string('sitename');

$table->softDeletes();
$table->timestamps();
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down() {
Schema::dropIfExists('wikis');
}
}
29 changes: 29 additions & 0 deletions database/migrations/2019_08_14_111000_create_invitations_table.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateInvitationsTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up() {
Schema::create('invitations', function (Blueprint $table) {
$table->increments('id');
$table->string('code')->unique();
$table->timestamps();
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down() {
Schema::dropIfExists('invitations');
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateWikiManagersTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up() {
Schema::create('wiki_managers', function (Blueprint $table) {
$table->increments('id');
$table->integer('user_id');
$table->integer('wiki_id');
$table->timestamps();
$table->unique(['user_id', 'wiki_id']);
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down() {
Schema::dropIfExists('wiki_managers');
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateUserVerificationTokensTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up() {
Schema::create('user_verification_tokens', function (Blueprint $table) {
$table->increments('id');
$table->integer('user_id');
$table->string('token', 100)->unique();
$table->timestamps();
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down() {
Schema::dropIfExists('user_verification_tokens');
}
}
32 changes: 32 additions & 0 deletions database/migrations/2019_08_31_163057_create_failed_jobs_table.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateFailedJobsTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up() {
Schema::create('failed_jobs', function (Blueprint $table) {
$table->bigIncrements('id');
$table->text('connection');
$table->text('queue');
$table->longText('payload');
$table->longText('exception');
$table->timestamp('failed_at')->useCurrent();
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down() {
Schema::dropIfExists('failed_jobs');
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateWikiDomainsTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up() {
Schema::create('wiki_domains', function (Blueprint $table) {
$table->increments('id');

$table->string('domain')->unique();
// The wiki_id that the domain was initially created for
// domains can not be reused.. (for now)
$table->integer('wiki_id')->nullable()->unsigned();

$table->timestamps();
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down() {
Schema::dropIfExists('wiki_domains');
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateQueryservicenamespacesTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up() {
Schema::create('queryservice_namespaces', function (Blueprint $table) {
$table->increments('id');

$table->string('namespace', 100)->unique();
// $table->string('internalHost', 100)->unique();
$table->string('backend', 100);

$table->integer('wiki_id')->nullable()->unsigned()->unique();

$table->timestamps();
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down() {
Schema::dropIfExists('queryservice_namespaces');
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateWikiSettingsTable extends Migration {
public function up() {
Schema::create('wiki_settings', function (Blueprint $table) {
$table->increments('id');
$table->string('name', 100);
$table->string('value', 200);
$table->integer('wiki_id')->nullable()->unsigned();

$table->index('wiki_id');
$table->unique(['wiki_id', 'name']);

$table->timestamps();
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down() {
Schema::dropIfExists('wiki_settings');
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateEventPageUpdatesTable extends Migration {
public function up() {
Schema::create('event_page_updates', function (Blueprint $table) {
$table->increments('id');
$table->integer('wiki_id');
// 14 allows 100 billion as an entity id..
$table->string('title', 14);
$table->integer('namespace');

$table->timestamps();
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down() {
Schema::dropIfExists('event_page_updates');
}
}
26 changes: 26 additions & 0 deletions database/migrations/2019_10_20_101600_create_qs_batches_table.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateQsBatchesTable extends Migration {
public function up() {
Schema::create('qs_batches', function (Blueprint $table) {
$table->increments('id');
$table->integer('eventFrom');
$table->integer('eventTo');
$table->integer('wiki_id');
$table->text('entityIds');
$table->boolean('done');

$table->index('done');

$table->timestamps();
});
}

public function down() {
Schema::dropIfExists('qs_batches');
}
}
Loading
Loading