Skip to content

Commit

Permalink
v2.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
c006 committed Jul 17, 2017
0 parents commit 9dc35c2
Show file tree
Hide file tree
Showing 10 changed files with 1,096 additions and 0 deletions.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2014 Jon Chambers

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
53 changes: 53 additions & 0 deletions Module.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?php
/**
* Created by PhpStorm.
* User: user
* Date: 6/7/14
* Time: 7:24 PM
*/
namespace c006\utility\migration;

/**
* Class Module
*
* @package c006\utility\migration
*/
class Module extends \yii\base\Module
{

/**
*
*/
const VERSION = '0.0.2-dev';

/**
* @var string
*/
public $controllerNamespace = 'c006\utility\migration\controllers';


/**
*
*/
public function init()
{
parent::init();
}


/**
* Override createController()
*
* @link https://github.com/yiisoft/yii2/issues/810
* @link http://www.yiiframework.com/forum/index.php/topic/21884-module-and-url-management/
*/
public function createController($route)
{
preg_match('/(default)/', $route, $match);
if (isset($match[0]))
return parent::createController($route);

return parent::createController("{$this->defaultRoute}/{$route}");
}

}
129 changes: 129 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
Yii2 Migration Utility
===================

**Current Version - v1.2.1**

+ Add JqueryAsset to DefaultController

This is a utility that writes the create table statement for migrations.
The table(s), indexes, foreign keys must already exist.

Foreign Key - uses link table and numbering, table / columns had potential to be too long

Supports

+ MySQL
+ MsSQL
+ PgSQL
+ SQLite

It automatically writes out all:

+ tables
+ columns
+ column types
+ column defaults
+ primary keys
+ composite keys
+ foreign key
+ indexes
+ Table data


Installation
------------

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-source "c006/yii2-migration-utility" "dev-master"
```

or add

```
"c006/yii2-migration-utility": "dev-master"
```

to the require section of your `composer.json` file.


Required
--------

Update either ***config/web.php*** (basic) or ***config/main.php*** (advanced)

>
'modules' => [
...
...
...
'utility' => [
'class' => 'c006\utility\migration\Module',
],
],



The tables must already exist in website schema.


Demo
-------

Demo: [http://demo.c006.us](http://demo.c006.us)


Usage
-----


###http://___[Your_Domain]___</span>/utility###

or

###http://___[Your_Domain]___</span>/?r=/utility###




Updates
--------

+ Table options per database type
+ Table indexes
+ Table data


Contributors
-----------

+ [Insolita](https://github.com/Insolita)
+ [Deele](https://github.com/Deele)
+ Sedov Sergey
+ fedemotta



Comments / Suggestions
--------------------

Please provide any helpful feedback or requests.

Thanks.














55 changes: 55 additions & 0 deletions assets/AppAssets.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?php
/**
* Created by PhpStorm.
* User: user
* Date: 5/24/14
* Time: 11:47 AM
*/
namespace c006\utility\migration\assets;

use yii\web\AssetBundle;
use yii\web\View;

/**
* Class AppAssets
*
* @package c006\utility\migration\assets
*/
class AppAssets extends AssetBundle
{

/**
* @inheritdoc
*/
public $sourcePath = '@vendor/c006/yii2-migration-utility/assets';

/**
* @inheritdoc
*/
public $css = [
];

/**
* @inheritdoc
*/
public $js = [
'c006-migration.js',
];

/**
* @inheritdoc
*/
public $depends = [
'yii\web\YiiAsset',
'yii\widgets\ActiveFormAsset',
'yii\bootstrap\BootstrapAsset',
];

/**
* @var array
*/
public $jsOptions = [
'position' => View::POS_END,
];

}
Loading

0 comments on commit 9dc35c2

Please sign in to comment.