Commit bf6b20a5 authored by abkrim's avatar abkrim 😀
Browse files

Move somre work to my project

parent 30d17292
Pipeline #220 passed with stages
in 1 minute and 25 seconds
<?php
/**
* table is name of table for save data of schemas for unique version
*/
return [
'table' => 'db_schema'
];
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateDbSchemasTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('db_schemas', function (Blueprint $table) {
$table->increments('id');
$table->string('connection',100)->nullable(false)->index();
$table->string('table',100)->nullable(false)->index();
$table->string('version', 25)->nullable(false)->index();
$table->text('schema');
$table->timestamps();
$table->unique(['connection', 'table', 'version']);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('db_schemas');
}
}
......@@ -24,13 +24,13 @@ class DbSchemaServiceProvider extends ServiceProvider
ListSchema::class,
]);
$this->publishes([
__DIR__.'/../config/config.php' => config_path('db-schema.php'),
], 'db-schema-config');
// $this->publishes([
// __DIR__.'/../config/config.php' => config_path('db-schema.php'),
// ], 'db-schema-config');
$this->publishes([
__DIR__.'/../database/migrations' => database_path('migrations'),
], 'db-schema-migrations');
// $this->publishes([
// __DIR__.'/../database/migrations' => database_path('migrations'),
// ], 'db-schema-migrations');
$this->commands([
......@@ -51,7 +51,7 @@ class DbSchemaServiceProvider extends ServiceProvider
public function register()
{
// Automatically apply the package configuration
$this->mergeConfigFrom(__DIR__.'/../config/config.php', 'db-schema');
// $this->mergeConfigFrom(__DIR__.'/../config/config.php', 'db-schema');
// Register the main class to use with the facade
$this->app->singleton('db-schema', function () {
......
......@@ -6,6 +6,7 @@ use Abkrim\DbSchema\DbSchema;
use Abkrim\DbSchema\DbSchemaServiceProvider;
use Abkrim\DbSchema\DbSchemaFacade;
use Faker\Factory as Faker;
use Illuminate\Database\QueryException;
use Illuminate\Support\Facades\DB;
use Orchestra\Testbench\TestCase;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment