Added migration script and add Model pagination dependency.
This commit is contained in:
parent
feb1bc810e
commit
c7186d040b
5 changed files with 93 additions and 1 deletions
|
@ -13,6 +13,7 @@
|
|||
"nesbot/carbon": "~1.22",
|
||||
"illuminate/database": "~5.5",
|
||||
"illuminate/filesystem": "~5.5",
|
||||
"illuminate/pagination": "~5.5",
|
||||
"doctrine/dbal": "~2.6",
|
||||
"swiftmailer/swiftmailer": "~6.0",
|
||||
"erusev/parsedown": "~1.6"
|
||||
|
@ -21,11 +22,22 @@
|
|||
"phpunit/phpunit": "~6.0"
|
||||
},
|
||||
"autoload": {
|
||||
"classmap": [
|
||||
"database"
|
||||
],
|
||||
"psr-4": {
|
||||
"Misuzu\\": "src/"
|
||||
},
|
||||
"files": [
|
||||
"utility.php"
|
||||
]
|
||||
},
|
||||
"scripts": {
|
||||
"post-install-cmd": [
|
||||
"php misuzu_migrate.php"
|
||||
]
|
||||
},
|
||||
"config": {
|
||||
"preferred-install": "dist"
|
||||
}
|
||||
}
|
||||
|
|
46
composer.lock
generated
46
composer.lock
generated
|
@ -4,7 +4,7 @@
|
|||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "fd3ae2504a3c120f29942565ef7cd403",
|
||||
"content-hash": "cf7183af01ce52a9430cef6cfcbc9213",
|
||||
"packages": [
|
||||
{
|
||||
"name": "doctrine/annotations",
|
||||
|
@ -815,6 +815,50 @@
|
|||
"homepage": "https://laravel.com",
|
||||
"time": "2017-12-14T13:33:54+00:00"
|
||||
},
|
||||
{
|
||||
"name": "illuminate/pagination",
|
||||
"version": "v5.5.28",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/illuminate/pagination.git",
|
||||
"reference": "90e59fedc7d4760db5d85d66a59507ceac0bf354"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/illuminate/pagination/zipball/90e59fedc7d4760db5d85d66a59507ceac0bf354",
|
||||
"reference": "90e59fedc7d4760db5d85d66a59507ceac0bf354",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"illuminate/contracts": "5.5.*",
|
||||
"illuminate/support": "5.5.*",
|
||||
"php": ">=7.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "5.5-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Illuminate\\Pagination\\": ""
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Taylor Otwell",
|
||||
"email": "taylor@laravel.com"
|
||||
}
|
||||
],
|
||||
"description": "The Illuminate Pagination package.",
|
||||
"homepage": "https://laravel.com",
|
||||
"time": "2017-10-13T15:07:13+00:00"
|
||||
},
|
||||
{
|
||||
"name": "illuminate/support",
|
||||
"version": "v5.5.28",
|
||||
|
|
31
misuzu_migrate.php
Normal file
31
misuzu_migrate.php
Normal file
|
@ -0,0 +1,31 @@
|
|||
<?php
|
||||
/**
|
||||
* Migration script
|
||||
* @todo Move this into a CLI commands system.
|
||||
*/
|
||||
|
||||
namespace Misuzu;
|
||||
|
||||
use Illuminate\Database\Capsule\Manager;
|
||||
use Illuminate\Database\ConnectionResolver;
|
||||
use Illuminate\Database\Migrations\DatabaseMigrationRepository;
|
||||
use Illuminate\Database\Schema\Builder;
|
||||
use Illuminate\Database\Migrations\Migrator;
|
||||
use Illuminate\Filesystem\Filesystem;
|
||||
|
||||
require_once __DIR__ . '/misuzu.php';
|
||||
|
||||
$resolver = new ConnectionResolver(['database' => Database::connection()]);
|
||||
$repository = new DatabaseMigrationRepository($resolver, 'migrations');
|
||||
$repository->setSource('database');
|
||||
$migrator = new Migrator($repository, $repository->getConnectionResolver(), new Filesystem);
|
||||
|
||||
if (!$migrator->repositoryExists()) {
|
||||
$repository->createRepository();
|
||||
}
|
||||
|
||||
$migrator->run(__DIR__ . '/database');
|
||||
|
||||
foreach ($migrator->getNotes() as $note) {
|
||||
echo strip_tags($note) . PHP_EOL;
|
||||
}
|
|
@ -121,6 +121,10 @@ class Application
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @todo Instead of reading a connections variable from the config,
|
||||
* the expected connections should be defined somewhere in this class.
|
||||
*/
|
||||
private function loadConfigDatabaseConnections(): void
|
||||
{
|
||||
$config = $this->config;
|
||||
|
|
|
@ -3,6 +3,7 @@ namespace Misuzu\Controllers;
|
|||
|
||||
use Misuzu\Application;
|
||||
use Misuzu\Database;
|
||||
use Misuzu\AyaseUser;
|
||||
|
||||
class HomeController extends Controller
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue