-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* develop: (24 commits) specify next release add readme add transactions documentation add commands documentation add sql documentation fix psalm setup documentation fix test add missing return type add changelog fix test failing on second run give access to the latest error add factory to have a fluent api to run migrations add Runner interface to make sure the same api between kinds of migration deduplicate code make sure to stop migrating when a migration fails fix invalid nullable type add commands migrations remove unused variable only run on linux ...
- Loading branch information
Showing
41 changed files
with
2,729 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
/.github export-ignore | ||
/proofs export-ignore | ||
/fixtures export-ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Documentation | ||
on: | ||
push: | ||
branches: [main] | ||
|
||
permissions: | ||
contents: write | ||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Configure Git Credentials | ||
run: | | ||
git config user.name github-actions[bot] | ||
git config user.email 41898282+github-actions[bot]@users.noreply.github.com | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.x | ||
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV | ||
- uses: actions/cache@v4 | ||
with: | ||
key: mkdocs-material-${{ env.cache_id }} | ||
path: .cache | ||
restore-keys: | | ||
mkdocs-material- | ||
- run: pip install mkdocs-material | ||
- run: mkdocs gh-deploy --force |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
/composer.lock | ||
/vendor | ||
/.cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Changelog | ||
|
||
## 1.0.0 - 2024-10-04 | ||
|
||
### Added | ||
|
||
- `Formal\Migrations\Factory` | ||
- `Formal\Migrations\SQL` | ||
- `Formal\Migrations\SQL\Migration` | ||
- `Formal\Migrations\SQL\Load` | ||
- `Formal\Migrations\Commands` | ||
- `Formal\Migrations\Commands\Migration` | ||
- `Formal\Migrations\Commands\Reference` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# This command is intended to be run on your computer | ||
serve-doc: | ||
docker run --rm -it -p 8000:8000 -v ${PWD}:/docs squidfunk/mkdocs-material | ||
|
||
build-doc: | ||
docker run --rm -it -v ${PWD}:/docs squidfunk/mkdocs-material build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
# migrations | ||
|
||
[![Build Status](https://github.com/formal/migrations/workflows/CI/badge.svg?branch=main)](https://github.com/formal/migrations/actions?query=workflow%3ACI) | ||
[![codecov](https://codecov.io/gh/formal/migrations/branch/develop/graph/badge.svg)](https://codecov.io/gh/formal/migrations) | ||
[![Type Coverage](https://shepherd.dev/github/formal/migrations/coverage.svg)](https://shepherd.dev/github/formal/migrations) | ||
[![Build Status](https://github.com/formal-php/migrations/workflows/CI/badge.svg?branch=main)](https://github.com/formal-php/migrations/actions?query=workflow%3ACI) | ||
[![codecov](https://codecov.io/gh/formal-php/migrations/branch/develop/graph/badge.svg)](https://codecov.io/gh/formal-php/migrations) | ||
[![Type Coverage](https://shepherd.dev/github/formal-php/migrations/coverage.svg)](https://shepherd.dev/github/formal-php/migrations) | ||
|
||
Description | ||
This library is a simple one way migration system. | ||
|
||
You can run both SQL and Commands migrations. | ||
|
||
## Installation | ||
|
||
|
@@ -14,4 +16,30 @@ composer require formal/migrations | |
|
||
## Usage | ||
|
||
Todo | ||
```php | ||
use Formal\Migrations\Factory; | ||
use Innmind\OperatingSystem\Factory as OS; | ||
use Innmind\Url\{ | ||
Url, | ||
Path, | ||
}; | ||
|
||
$dsn = Url::of('mysql://user:[email protected]:3306/database'); | ||
|
||
Factory::of(OS::build()) | ||
->storeVersionsInDatabase($dsn) | ||
->sql() | ||
->files(Path::of('migrations/folder/')) | ||
->migrate($dsn) | ||
->match( | ||
static fn() => print('Everything has been migrated'), | ||
static fn(\Throwable $error) => printf( | ||
'Migrations failed with the message : %s', | ||
$error->getMessage(), | ||
), | ||
); | ||
``` | ||
|
||
## Documentation | ||
|
||
Full documentation available [here](https://formal-php.github.io/migrations/). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
services: | ||
mariadb: | ||
image: mariadb:10 | ||
environment: | ||
MYSQL_ROOT_PASSWORD: root | ||
MYSQL_DATABASE: example | ||
ports: | ||
- '3306:3306' |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
@font-face { | ||
font-family: "Monaspace Neon"; | ||
font-weight: normal; | ||
font-style: normal; | ||
src: url("../fonts/MonaspaceNeon-Regular.woff"); | ||
} | ||
|
||
:root { | ||
--md-code-font: "Monaspace Neon"; | ||
} | ||
|
||
:root { | ||
--light-md-code-hl-number-color: #f76d47; | ||
--light-md-code-hl-function-color: #6384b9; | ||
--light-md-code-hl-operator-color: #39adb5; | ||
--light-md-code-hl-constant-color: #7c4dff; | ||
--light-md-code-hl-string-color: #9fc06f; | ||
--light-md-code-hl-punctuation-color: #39adb5; | ||
--light-md-code-hl-keyword-color: #7c4dff; | ||
--light-md-code-hl-variable-color: #80cbc4; | ||
--light-md-code-hl-comment-color: #ccd7da; | ||
--light-md-code-bg-color: #fafafa; | ||
--light-md-code-fg-color: #ffb62c; | ||
--light-md-code-hl-variable-color: #6384b9; | ||
--dark-md-code-hl-number-color: #f78c6c; | ||
--dark-md-code-hl-function-color: #82aaff; | ||
--dark-md-code-hl-operator-color: #89ddff; | ||
--dark-md-code-hl-constant-color: #c792ea; | ||
--dark-md-code-hl-string-color: #c3e88d; | ||
--dark-md-code-hl-punctuation-color: #89ddff; | ||
--dark-md-code-hl-keyword-color: #c792ea; | ||
--dark-md-code-hl-variable-color: #e8f9f9; | ||
--dark-md-code-hl-comment-color: #546e7a; | ||
--dark-md-code-bg-color: #263238; | ||
--dark-md-code-fg-color: #ffcb6b; | ||
--dark-md-code-hl-variable-color: #82aaff; | ||
} | ||
|
||
@media (prefers-color-scheme: light) { | ||
.language-php > * { | ||
--md-code-hl-number-color: var(--light-md-code-hl-number-color); | ||
--md-code-hl-function-color: var(--light-md-code-hl-function-color); | ||
--md-code-hl-operator-color: var(--light-md-code-hl-operator-color); | ||
--md-code-hl-constant-color: var(--light-md-code-hl-constant-color); | ||
--md-code-hl-string-color: var(--light-md-code-hl-string-color); | ||
--md-code-hl-punctuation-color: var(--light-md-code-hl-punctuation-color); | ||
--md-code-hl-keyword-color: var(--light-md-code-hl-keyword-color); | ||
--md-code-hl-variable-color: var(--light-md-code-hl-variable-color); | ||
--md-code-hl-comment-color: var(--light-md-code-hl-comment-color); | ||
--md-code-bg-color: var(--light-md-code-bg-color); | ||
--md-code-fg-color: var(--light-md-code-fg-color); | ||
} | ||
|
||
.language-php .na { | ||
--md-code-hl-variable-color: var(--light-md-code-hl-variable-color); | ||
} | ||
} | ||
|
||
[data-md-color-media="(prefers-color-scheme: light)"] .language-php > * { | ||
--md-code-hl-number-color: var(--light-md-code-hl-number-color); | ||
--md-code-hl-function-color: var(--light-md-code-hl-function-color); | ||
--md-code-hl-operator-color: var(--light-md-code-hl-operator-color); | ||
--md-code-hl-constant-color: var(--light-md-code-hl-constant-color); | ||
--md-code-hl-string-color: var(--light-md-code-hl-string-color); | ||
--md-code-hl-punctuation-color: var(--light-md-code-hl-punctuation-color); | ||
--md-code-hl-keyword-color: var(--light-md-code-hl-keyword-color); | ||
--md-code-hl-variable-color: var(--light-md-code-hl-variable-color); | ||
--md-code-hl-comment-color: var(--light-md-code-hl-comment-color); | ||
--md-code-bg-color: var(--light-md-code-bg-color); | ||
--md-code-fg-color: var(--light-md-code-fg-color); | ||
} | ||
|
||
[data-md-color-media="(prefers-color-scheme: light)"] .language-php .na { | ||
--md-code-hl-variable-color: var(--light-md-code-hl-variable-color); | ||
} | ||
|
||
@media (prefers-color-scheme: dark) { | ||
.language-php > * { | ||
--md-code-hl-number-color: var(--dark-md-code-hl-number-color); | ||
--md-code-hl-function-color: var(--dark-md-code-hl-function-color); | ||
--md-code-hl-operator-color: var(--dark-md-code-hl-operator-color); | ||
--md-code-hl-constant-color: var(--dark-md-code-hl-constant-color); | ||
--md-code-hl-string-color: var(--dark-md-code-hl-string-color); | ||
--md-code-hl-punctuation-color: var(--dark-md-code-hl-punctuation-color); | ||
--md-code-hl-keyword-color: var(--dark-md-code-hl-keyword-color); | ||
--md-code-hl-variable-color: var(--dark-md-code-hl-variable-color); | ||
--md-code-hl-comment-color: var(--dark-md-code-hl-comment-color); | ||
--md-code-bg-color: var(--dark-md-code-bg-color); | ||
--md-code-fg-color: var(--dark-md-code-fg-color); | ||
} | ||
|
||
.language-php .na { | ||
--md-code-hl-variable-color: var(--dark-md-code-hl-variable-color); | ||
} | ||
} | ||
|
||
[data-md-color-media="(prefers-color-scheme: dark)"] .language-php > * { | ||
--md-code-hl-number-color: var(--dark-md-code-hl-number-color); | ||
--md-code-hl-function-color: var(--dark-md-code-hl-function-color); | ||
--md-code-hl-operator-color: var(--dark-md-code-hl-operator-color); | ||
--md-code-hl-constant-color: var(--dark-md-code-hl-constant-color); | ||
--md-code-hl-string-color: var(--dark-md-code-hl-string-color); | ||
--md-code-hl-punctuation-color: var(--dark-md-code-hl-punctuation-color); | ||
--md-code-hl-keyword-color: var(--dark-md-code-hl-keyword-color); | ||
--md-code-hl-variable-color: var(--dark-md-code-hl-variable-color); | ||
--md-code-hl-comment-color: var(--dark-md-code-hl-comment-color); | ||
--md-code-bg-color: var(--dark-md-code-bg-color); | ||
--md-code-fg-color: var(--dark-md-code-fg-color); | ||
} | ||
|
||
[data-md-color-media="(prefers-color-scheme: dark)"] .language-php .na { | ||
--md-code-hl-variable-color: var(--dark-md-code-hl-variable-color); | ||
} |
Oops, something went wrong.