Skip to content

Commit

Permalink
Merge pull request #10 from ekomi-ltd/IT-15900-sync-schema-and-migrat…
Browse files Browse the repository at this point in the history
…ions

IT-15900 : Sync schema and migrations
  • Loading branch information
amanmukhtar authored May 10, 2024
2 parents c85c076 + a1aef91 commit 467e360
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 4 deletions.
8 changes: 5 additions & 3 deletions database/migrations/2016_12_27_232934_create_clicks_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ class CreateClicksTable extends Migration
*/
public function up()
{
Schema::create('clicks', function(Blueprint $table)
//commenting the code to sync the schema with production database
/*Schema::create('clicks', function(Blueprint $table)
{
$table->engine = 'InnoDB';
Expand All @@ -31,7 +32,7 @@ public function up()
$table->foreign('link_id')->references('id')->on('links')->onDelete('cascade');
$table->timestamps();
});
});*/
}
/**
* Reverse the migrations.
Expand All @@ -40,6 +41,7 @@ public function up()
*/
public function down()
{
Schema::drop('clicks');
//commenting the code to sync the schema with production database
// Schema::drop('clicks');
}
}
36 changes: 36 additions & 0 deletions database/migrations/2017_12_21_095425_create_api_quota_index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

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

class CreateApiQuotaIndex extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('links', function (Blueprint $table)
{
$table->index(
['created_at', 'creator', 'is_api'],
'api_quota_index'
);
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('links', function (Blueprint $table)
{
$table->dropIndex('api_quota_index');
});
}
}
34 changes: 34 additions & 0 deletions database/migrations/2018_04_09_095425_create_session_index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

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

class CreateSessionIndex extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('sessions', function (Blueprint $table) {
$table->string('id')->unique();
$table->unsignedInteger('user_id')->nullable();
$table->string('ip_address', 45)->nullable();
$table->text('user_agent')->nullable();
$table->text('payload');
$table->integer('last_activity');
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('sessions');
}
}
2 changes: 1 addition & 1 deletion scripts/00-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ set -o errexit -o nounset -o pipefail

# Running Migrations
echo "Starting migrations! ..."
php artisan migrate --force
#php artisan migrate --force

0 comments on commit 467e360

Please sign in to comment.