Skip to content
This repository has been archived by the owner on Oct 15, 2020. It is now read-only.

Commit

Permalink
Releasing 2.0.2 into master (#42)
Browse files Browse the repository at this point in the history
* add migrator console

* Add but more documentation

* fix up readme

* schema should not depend on development packages

* develop to require develop versions

* fix alter field

* add drop field

* add comment

* add changelog

* fix version requirement

* Update composer.json

* Update composer.json

* Update composer.json

* Update BasicTest.php

* Update SchemaTestcaseTest.php

* Update phpunit.xml

* Update .travis.yml

* Update phpunit.xml

* Update SchemaTestcaseTest.php

* Update phpunit.xml

* Update SchemaTestcaseTest.php

* Update .travis.yml

* Update .travis.yml

* Update .travis.yml

* Update SchemaTestcaseTest.php

* move abstract testcase to tests

* Apply fixes from StyleCI

* enable debug

* Apply fixes from StyleCI

* move

* fix dsn

* proper dsn

* Update README.md

* globals

* Apply fixes from StyleCI

* work on dsn

* Apply fixes from StyleCI

* ouch

* include both tests - sqlite and mysql

* fix

* fix types

* disable unsupported test

* add comment

* remove debug

* fix codeclimate config

* fix escape_char

* debug

* Apply fixes from StyleCI

* crap

* PostGre suppport

* set max_connections

* support PostGreSQL starting from v.10 only

* get rid of connection

* Update .codeclimate.yml

* add support for changing field name

* Apply fixes from StyleCI

* Update Migration.php

* add rename table support

* Extend to all DataType options with PHPUnit Tests

* add transcode table for field type => datatype database
* tested on SQLite and MySQL

* Change default Type from VARCHAR256 to TEXT

more space is better than less, this class is very useful during development,
after that will be disabled and database must be optimized with other tools.

i changed because i had a problem storing serialized EXIF in array datatype

* drop php 5.6 support

* Add transcoding for Field Reference_One
climate error correction

* Reformatting and change variables name

switch to codeformatting PSR-1,PSR-2
add hasOne in Test

* add creation of file models class via console to "reverse engineering" DB

fixed mysql float was mistyped uppercase

* Add Doc for function createModelFromTable

* Adjust naming for transcodes on SQLite

* add hasOne detect field type

* Remove some editor autoadd - f... phpstorm

* format code in ->getTranscodeTypeKeyFromField

* compatibility with new data namespace

* Apply fixes from StyleCI

* better handling of text, array and object fields. also fix few others.

* Apply fixes from StyleCI

* add type options

* added changelog

* working on version dependencies

* for development branch we need development dependencies

* make types easier to extend and improve PgSQL types support

* Apply fixes from StyleCI

* more dependencies and easier to extend migrator console

* oops

* no need for this anymore

* implements factory method getMigration, uses connection->driver, few changes in phpunit test suite, more tests

* Apply fixes from StyleCI

* change docs

* Better PostgreSQL support

* fix datetime mess

* typo

* use getFields() in Model rather than hack through elements

* Composer - Drop PHP < 7.2

* Big refactor

* Merge remote-tracking branch 'remotes/atk4/develop' into add-type-transcoding

* StyleCi

* StyleCi 1

* remove php < 7.2 from travis

* Removed function for creation of Model File

* Refactor variable names and removed extra line

* Refactor 1 comment to be consistent with the others below

* Add support for GitHub actions (#17)

* Add GitHub Action support

* disable travis

* tweak bundler

* wip

* wip

* wip

* Update unit-tests.yml

* Apply fixes from StyleCI

* Add test case (#21)

* separate wf and local tests

* fix host

* better testcase

* Apply fixes from StyleCI

* Fix english plural (#28)

* Fix changes count for empty type (#32)

* Improve column creation - add not-null and unsigned for int refs option (#29)

* Fix nullable for references (#34)

* Fix CS to PSR-12 (#35)

* Change CS config to PSR-12

* Change CS to PSR-12 - fix errors by phpcbf

Command: php vendor\squizlabs\php_codesniffer\bin\phpcbf

* Apply fixes from StyleCI

* Feature/release mechanics (#36)

* add require-release

* Update bundler.yml

* Update bundler.yml

* Update composer.json

* Update bundler.yml

* Update bundler.yml

* Update composer.json

* Update composer.json

* Update bundler.yml

* Update composer.json

* Setting release dependencies

* fix bad merge, code duplication

Co-authored-by: Romans Malinovskis <me@nearly.guru>
Co-authored-by: Imants Horsts <DarkSide666@users.noreply.github.com>
Co-authored-by: Francesco Danti <fdanti@gmail.com>
Co-authored-by: Michael Voříšek <mvorisek@mvorisek.cz>
Co-authored-by: GitHub Web Flow <noreply@github.com>
  • Loading branch information
6 people authored Feb 11, 2020
1 parent 2d39d8f commit de74503
Show file tree
Hide file tree
Showing 14 changed files with 242 additions and 125 deletions.
2 changes: 1 addition & 1 deletion .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins:
phpcodesniffer:
enabled: false
config:
standard: "PSR1,PSR2"
standard: "PSR12"
ignore_warnings: true
encoding: utf-8
phpmd:
Expand Down
17 changes: 8 additions & 9 deletions .github/workflows/bundler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,25 @@ jobs:
- run: echo ${{ github.ref }}
- name: Update to stable dependencies
run: |
jq 'del(.require["atk4/dsql"]) | del(.["require-dev"]["atk4/ui"]) | del(.["require-dev"]["atk4/data"])' < composer.json > tmp && mv tmp composer.json
composer require --no-progress --no-suggest --prefer-dist --optimize-autoloader atk4/dsql
#composer require --dev atk4/data # atk4/ui - removed temporarily until atk4/ui is released
composer update --no-suggest --prefer-dist --optimize-autoloader
# replaces X keys with X-release keys
jq '. as $in | reduce (keys_unsorted[] | select(endswith("-release")|not)) as $k ({}; . + {($k) : (($k + "-release") as $kr | $in | if has($kr) then .[$kr] else .[$k] end) } )' < composer.json > tmp && mv tmp composer.json
v=$(echo ${{ github.ref }} | cut -d / -f 4)
echo "::set-env name=version::$v"
- uses: teaminkling/autocommit@master
with:
commit-message: Setting current dependencies
commit-message: Setting release dependencies
- uses: ad-m/github-push-action@master
with:
branch: ${{ github.ref }}
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: pull-request
uses: repo-sync/pull-request@v2
uses: romaninsh/pull-request@master
with:
source_branch: "" # If blank, default: triggered branch
source_branch: "release/${{ env.version }}"
destination_branch: "master" # If blank, default: master
pr_title: "Releasing ${{ github.ref }} into master"
pr_title: "Releasing ${{ env.version }} into master"
pr_body: |
- [ ] Review changes (must include stable dependencies)
- [ ] Merge this PR into master (will delete ${{ github.ref }})
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
run: vendor/bin/phpunit --configuration phpunit.xml --coverage-text --exclude-group dns

- name: MySQL Testing
run: vendor/bin/phpunit --configuration phpunit-mysql.xml --exclude-group dns
run: vendor/bin/phpunit --configuration phpunit-mysql-workflow.xml --exclude-group dns

- name: Merge coverage logs
run: vendor/bin/phpcov merge build/logs/ --clover build/logs/cc.xml;
Expand Down
6 changes: 6 additions & 0 deletions .phpcs.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<ruleset>
<file>.</file>
<exclude-pattern>/vendor/*$</exclude-pattern>

<rule ref="PSR12" />
</ruleset>
15 changes: 9 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,19 @@
"php": ">=7.2.0",
"atk4/dsql": "^2.0"
},
"suggest": {
"atk4/data": "*",
"atk4/ui": "*",
"jdorn/sql-formatter": "*"
},
"require-dev": {
"atk4/data": "^2.0",
"atk4/ui": "^2.0",
"phpunit/phpunit": "<6",
"phpunit/dbunit": ">=1.2",
"phpunit/phpcov": "*",
"codeclimate/php-test-reporter": "*"
"codeclimate/php-test-reporter": "*",
"squizlabs/php_codesniffer": "^3.5"
},
"suggest": {
"atk4/data": "^2.0",
"atk4/ui": "^2.0",
"jdorn/sql-formatter": "*"
},
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion demos/init.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
include '../vendor/autoload.php';
$db = \atk4\data\Persistence::connect('mysql://root:root@localhost/test');

$db->connection = new \atk4\dsql\Connection_Dumper(['connection'=>$db->connection]);
$db->connection = new \atk4\dsql\Connection_Dumper(['connection' => $db->connection]);
2 changes: 1 addition & 1 deletion demos/modelmigrator.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function init()
// ok, now we surely have DB!

$m->save([
'name'=> 'John'.rand(1, 100),
'name' => 'John'.rand(1, 100),
]);
} catch (\atk4\core\Exception $e) {
echo $e->getColorfulText();
Expand Down
24 changes: 24 additions & 0 deletions phpunit-mysql-workflow.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<phpunit colors="true" bootstrap="vendor/autoload.php" printerClass="atk4\core\PHPUnit_AgileResultPrinter">
<php>
<var name="DB_DSN" value="mysql:dbname=dsql_test;host=mysql" />
<var name="DB_USER" value="root" />
<var name="DB_PASSWD" value="password" />
<var name="DB_DBNAME" value="dsql_test" />
</php>
<filter>
<blacklist>
<directory suffix=".php">./vendor</directory>
</blacklist>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./src</directory>
</whitelist>
</filter>
<testsuites>
<testsuite name="tests">
<directory>tests</directory>
</testsuite>
</testsuites>
<logging>
<log type="coverage-php" target="build/logs/clover-mysql.cov"/>
</logging>
</phpunit>
6 changes: 3 additions & 3 deletions phpunit-mysql.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<phpunit colors="true" bootstrap="vendor/autoload.php" printerClass="atk4\core\PHPUnit_AgileResultPrinter">
<php>
<var name="DB_DSN" value="mysql:dbname=dsql_test;host=mysql" />
<var name="DB_USER" value="root" />
<var name="DB_PASSWD" value="password" />
<var name="DB_DSN" value="mysql:dbname=dsql_test;host=localhost" />
<var name="DB_USER" value="travis" />
<var name="DB_PASSWD" value="" />
<var name="DB_DBNAME" value="dsql_test" />
</php>
<filter>
Expand Down
Loading

0 comments on commit de74503

Please sign in to comment.