Skip to content

Commit

Permalink
Merge pull request #68 from waynestate/ignore-creating-tables-if-they…
Browse files Browse the repository at this point in the history
…-already-exist

Ignore creating tables, if they already exist
  • Loading branch information
chrispelzer authored Nov 2, 2022
2 parents caf46cb + 047cc44 commit aa834dc
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 23 deletions.
7 changes: 3 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Changed
* Removed badges except the download since it seems to be only one working
## [1.1.4] - 2022-11-02
### Fixed
* Add check for migrations to make sure the table doesn't exist before trying to create it. by @chrispelzer in https://github.com/waynestate/nova-ckeditor4-field/pull/68 https://github.com/waynestate/nova-ckeditor4-field/issues/67

## [1.1.3] - 2022-10-13
### Changed
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Laravel Nova CKEditor 4 Field

[![Daily Downloads](http://poser.pugx.org/waynestate/nova-ckeditor4-field/d/daily)](https://packagist.org/packages/waynestate/nova-ckeditor4-field)

[![Latest Stable Version](http://poser.pugx.org/waynestate/nova-ckeditor4-field/v)](https://packagist.org/packages/waynestate/nova-ckeditor4-field) [![Daily Downloads](http://poser.pugx.org/waynestate/nova-ckeditor4-field/d/daily)](https://packagist.org/packages/waynestate/nova-ckeditor4-field)
[![Total Downloads](http://poser.pugx.org/waynestate/nova-ckeditor4-field/downloads)](https://packagist.org/packages/waynestate/nova-ckeditor4-field) [![Latest Unstable Version](http://poser.pugx.org/waynestate/nova-ckeditor4-field/v/unstable)](https://packagist.org/packages/waynestate/nova-ckeditor4-field) [![License](http://poser.pugx.org/waynestate/nova-ckeditor4-field/license)](https://packagist.org/packages/waynestate/nova-ckeditor4-field) [![PHP Version Require](http://poser.pugx.org/waynestate/nova-ckeditor4-field/require/php)](https://packagist.org/packages/waynestate/nova-ckeditor4-field)

This nova package allows you to use [CKEditor 4](https://ckeditor.com/ckeditor-4/) for text areas using Nova v4.

Expand Down
38 changes: 21 additions & 17 deletions database/migrations/create_ckeditor_attachment_tables.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,29 @@
*/
public function up()
{
Schema::create('nova_pending_ckeditor_attachments', function (Blueprint $table) {
$table->increments('id');
$table->string('draft_id')->index();
$table->string('attachment');
$table->string('disk');
$table->timestamps();
});
if (!Schema::hasTable('nova_pending_ckeditor_attachments')) {
Schema::create('nova_pending_ckeditor_attachments', function (Blueprint $table) {
$table->increments('id');
$table->string('draft_id')->index();
$table->string('attachment');
$table->string('disk');
$table->timestamps();
});
}

Schema::create('nova_ckeditor_attachments', function (Blueprint $table) {
$table->increments('id');
$table->string('attachable_type');
$table->unsignedInteger('attachable_id');
$table->string('attachment');
$table->string('disk');
$table->string('url')->index();
$table->timestamps();
if (!Schema::hasTable('nova_ckeditor_attachments')) {
Schema::create('nova_ckeditor_attachments', function (Blueprint $table) {
$table->increments('id');
$table->string('attachable_type');
$table->unsignedInteger('attachable_id');
$table->string('attachment');
$table->string('disk');
$table->string('url')->index();
$table->timestamps();

$table->index(['attachable_type', 'attachable_id']);
});
$table->index(['attachable_type', 'attachable_id']);
});
}
}

/**
Expand Down

0 comments on commit aa834dc

Please sign in to comment.