mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 06:21:27 +00:00
Update migrations
This commit is contained in:
parent
a3d76ee522
commit
251e455c25
2 changed files with 38 additions and 4 deletions
|
@ -14,7 +14,7 @@ class AddProvidersColumnToOauthClientsTable extends Migration
|
||||||
public function up()
|
public function up()
|
||||||
{
|
{
|
||||||
Schema::table('oauth_clients', function (Blueprint $table) {
|
Schema::table('oauth_clients', function (Blueprint $table) {
|
||||||
if(Schema::hasColumn('oauth_clients', 'provider') == false) {
|
if(Schema::hasTable('oauth_clients') && Schema::hasColumn('oauth_clients', 'provider') == false) {
|
||||||
$table->string('provider')->after('secret')->nullable();
|
$table->string('provider')->after('secret')->nullable();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -27,8 +27,10 @@ class AddProvidersColumnToOauthClientsTable extends Migration
|
||||||
*/
|
*/
|
||||||
public function down()
|
public function down()
|
||||||
{
|
{
|
||||||
Schema::table('oauth_clients', function (Blueprint $table) {
|
if(Schema::hasTable('oauth_clients')) {
|
||||||
$table->dropColumn('provider');
|
Schema::table('oauth_clients', function (Blueprint $table) {
|
||||||
});
|
$table->dropColumn('provider');
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
32
database/migrations/2022_04_08_065311_create_cache_table.php
Normal file
32
database/migrations/2022_04_08_065311_create_cache_table.php
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
class CreateCacheTable extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::create('cache', function (Blueprint $table) {
|
||||||
|
$table->string('key')->primary();
|
||||||
|
$table->mediumText('value');
|
||||||
|
$table->integer('expiration');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('cache');
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue