Skip to content

Commit 3360a0b

Browse files
authored
Merge pull request #11 from TomHAnderson/hotfix/database-schema
Hotfix/database schema
2 parents 27d104d + 5db90c8 commit 3360a0b

File tree

8 files changed

+28
-20
lines changed

8 files changed

+28
-20
lines changed

.env.example

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ LOG_DEPRECATIONS_CHANNEL=null
99
LOG_LEVEL=debug
1010

1111
DB_CONNECTION=mysql
12-
DB_HOST=mysql
12+
DB_HOST=127.0.0.1
1313
DB_PORT=3306
14-
DB_DATABASE=graphql
15-
DB_USERNAME=ldog
16-
DB_PASSWORD=123
14+
DB_DATABASE=ldog
15+
DB_USERNAME=root
16+
DB_PASSWORD=password
1717

1818
BROADCAST_DRIVER=log
1919
CACHE_DRIVER=file
Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ name: ldog
33
on: [push, pull_request]
44
jobs:
55
laravel:
6-
name: Laravel (PHP ${{ matrix.php-versions }})
6+
name: ldog (PHP ${{ matrix.php-versions }})
77
runs-on: ubuntu-latest
88
env:
9-
DB_DATABASE: laravel
9+
DB_DATABASE: ldog
1010
DB_USERNAME: root
1111
DB_PASSWORD: password
1212
BROADCAST_DRIVER: log
@@ -21,7 +21,7 @@ jobs:
2121
env:
2222
MYSQL_ALLOW_EMPTY_PASSWORD: false
2323
MYSQL_ROOT_PASSWORD: password
24-
MYSQL_DATABASE: laravel
24+
MYSQL_DATABASE: ldog
2525
ports:
2626
- 3306/tcp
2727
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
@@ -76,7 +76,12 @@ jobs:
7676
- name: Clear Config
7777
run: php artisan config:clear
7878

79-
- name: Test
79+
- name: Create Database
80+
run: php artisan doctrine:schema:create
81+
env:
82+
DB_PORT: ${{ job.services.mysql.ports['3306'] }}
83+
84+
- name: Test Code Quality
8085
run: composer test
8186
env:
8287
DB_PORT: ${{ job.services.mysql.ports['3306'] }}

config/doctrine-orm-metadata/App.Doctrine.ORM.Entity.Artist.dcm.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<id name="id" type="bigint">
55
<generator strategy="AUTO"/>
66
</id>
7-
<field name="name" type="string" nullable="false"/>
7+
<field name="name" type="string" unique="true" nullable="false"/>
88
<one-to-many field="performances" target-entity="App\Doctrine\ORM\Entity\Performance" mapped-by="artist"/>
99
</entity>
1010
</doctrine-mapping>

config/doctrine-orm-metadata/App.Doctrine.ORM.Entity.User.dcm.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<generator strategy="AUTO"/>
66
</id>
77
<field name="name" type="string" nullable="false"/>
8-
<field name="email" type="string" nullable="false"/>
8+
<field name="email" type="string" unique="true" nullable="false"/>
99
<field name="password" type="string" nullable="false"/>
1010
<many-to-many field="recordings" target-entity="App\Doctrine\ORM\Entity\Recording" inversed-by="users">
1111
<join-table name="RecordingToUser">

config/doctrine.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use Doctrine\ORM\EntityRepository;
66
use Doctrine\ORM\Mapping\DefaultNamingStrategy;
7+
use Ramsey\Uuid\Doctrine\UuidType;
78

89
return [
910

@@ -121,7 +122,9 @@
121122
| Create a custom or override a Doctrine Type
122123
|--------------------------------------------------------------------------
123124
*/
124-
'custom_types' => [],
125+
'custom_types' => [
126+
UuidType::NAME => UuidType::class,
127+
],
125128
/*
126129
|--------------------------------------------------------------------------
127130
| DQL custom datetime functions

database/database.sqlite

8 KB
Binary file not shown.

ldog.skipper

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,31 @@
33
<module name="\ldog" local-name="ldog" namespace="\App\Doctrine\ORM\Entity" local-namespace="\App\Doctrine\ORM\Entity" export-format="Doctrine2Xml" export-path="config/doctrine-orm-metadata" uuid="d5f257f8-d854-4bae-a05d-1ed8673c7eb5">
44
<entity name="\App\Doctrine\ORM\Entity\Artist" local-name="Artist" namespace="\App\Doctrine\ORM\Entity" uuid="10de66e4-a8b3-44a9-a6d0-a9fd28338fe2">
55
<field name="id" type="bigint" required="true" unique="true" primary="true" auto-increment="true" uuid="9d8eb724-b4f3-414c-9d1a-48bd61008f33"/>
6-
<field name="name" type="string" required="true" uuid="b5bf5f02-5032-4637-9d89-af0c6748d4fc"/>
6+
<field name="name" type="string" required="true" unique="true" uuid="b5bf5f02-5032-4637-9d89-af0c6748d4fc"/>
77
</entity>
88
<entity name="\App\Doctrine\ORM\Entity\Performance" local-name="Performance" namespace="\App\Doctrine\ORM\Entity" uuid="8a04b312-72bb-4723-baac-75502524ae38">
99
<field name="id" type="integer" required="true" unique="true" primary="true" auto-increment="true" uuid="f7d648ed-ac22-4020-8711-f16cf6851f82"/>
10+
<field name="artist_id" type="bigint" required="true" uuid="f77a7b2c-d4f7-43f1-a727-5ab5e965b128"/>
1011
<field name="venue" type="string" uuid="f07a7a76-a781-446e-9b9b-bc2a32f12073"/>
1112
<field name="city" type="string" uuid="0dc8ac15-38f0-40ab-90dc-38fb939a6e86"/>
1213
<field name="state" type="string" uuid="b9d6c7ac-8c46-4d74-91a7-75ec51ca46be"/>
1314
<field name="performanceDate" type="datetime" required="true" uuid="6445ff83-a7ec-43ef-852a-a236abd3cc4c"/>
14-
<field name="artist_id" type="bigint" required="true" uuid="f77a7b2c-d4f7-43f1-a727-5ab5e965b128"/>
1515
</entity>
1616
<association from="\App\Doctrine\ORM\Entity\Performance" to="\App\Doctrine\ORM\Entity\Artist" caption="artist performances" owner-alias="performances" inverse-alias="artist" many-owner="true" many-inverse="false" parent-required="true" uuid="4f0247e2-6d76-42f9-b56b-52306c2fa201">
1717
<association-field from="artist_id" to="id" uuid="8ba1d43e-9bcc-4c68-9470-e2d1ce7e8191"/>
1818
</association>
1919
<entity name="\App\Doctrine\ORM\Entity\Recording" local-name="Recording" namespace="\App\Doctrine\ORM\Entity" uuid="ad470906-9e63-41e7-9558-979789bc2d28">
2020
<field name="id" type="integer" required="true" unique="true" primary="true" auto-increment="true" uuid="4f7b2f73-cdf8-46af-bca1-0c1a4dbda738"/>
21-
<field name="source" type="text" required="true" uuid="e05ef23e-d672-4e9c-8103-bb25006bd851"/>
2221
<field name="performance_id" type="integer" required="true" uuid="6fdad895-ce70-4ec6-a2d5-27ab3377fc2a"/>
22+
<field name="source" type="text" required="true" uuid="e05ef23e-d672-4e9c-8103-bb25006bd851"/>
2323
</entity>
2424
<association from="\App\Doctrine\ORM\Entity\Recording" to="\App\Doctrine\ORM\Entity\Performance" caption="performance recordings" owner-alias="recordings" inverse-alias="performance" many-owner="true" many-inverse="false" parent-required="true" uuid="ab34ba86-e61e-458a-87e7-9dfa2aa1f391">
2525
<association-field from="performance_id" to="id" uuid="d65c0af7-1f4e-4036-a316-cb32ac3403d5"/>
2626
</association>
2727
<entity name="\App\Doctrine\ORM\Entity\User" local-name="User" namespace="\App\Doctrine\ORM\Entity" uuid="568a03b7-3dd5-435a-9bc8-869bc673923c">
2828
<field name="id" type="integer" required="true" unique="true" primary="true" auto-increment="true" uuid="1815339a-10e1-4ab0-9d3d-5fa347c3eadb"/>
2929
<field name="name" type="string" required="true" uuid="7f1988fe-14c8-4d3b-87c8-56ca5ed86385"/>
30-
<field name="email" type="string" required="true" uuid="b7e9c340-9589-4400-8f97-1c2a8d95a758"/>
30+
<field name="email" type="string" required="true" unique="true" uuid="b7e9c340-9589-4400-8f97-1c2a8d95a758"/>
3131
<field name="password" type="string" required="true" uuid="a249742e-2404-4844-994e-a7ceaf35705d"/>
3232
</entity>
3333
<entity name="\App\Doctrine\ORM\Entity\RecordingToUser" local-name="RecordingToUser" namespace="\App\Doctrine\ORM\Entity" uuid="e5603f71-6798-480b-bcf8-0d185a08e653">
@@ -51,14 +51,14 @@
5151
<visual-data>
5252
<association uuid="4f0247e2-6d76-42f9-b56b-52306c2fa201" caption1-position-x="0" caption1-position-y="0" center-position-x="0" center-position-y="0" color="#969696"/>
5353
<association uuid="ab34ba86-e61e-458a-87e7-9dfa2aa1f391" caption1-position-x="0" caption1-position-y="0" center-position-x="0" center-position-y="0" color="#969696"/>
54-
<comment uuid="0e4ff410-5025-42fd-89ae-0d05319ab49b" bg-color="#FFFFE0" position-x="489" position-y="333" size-x="6" size-x2="128" size-y="-3" size-y2="63" txt-color="#000000"/>
55-
<entity uuid="10de66e4-a8b3-44a9-a6d0-a9fd28338fe2" bg-color="#FFFFFF" hdr-color="#D2D2D2" position-x="-20" position-y="-44" size-x="0" size-x2="77" size-y="0" size-y2="45"/>
56-
<entity uuid="568a03b7-3dd5-435a-9bc8-869bc673923c" bg-color="#FFFFFF" hdr-color="#D2D2D2" position-x="-16" position-y="136" size-x="0" size-x2="93" size-y="0" size-y2="73"/>
54+
<comment uuid="0e4ff410-5025-42fd-89ae-0d05319ab49b" bg-color="#FFFFE0" position-x="283" position-y="253" size-x="6" size-x2="128" size-y="-3" size-y2="63" txt-color="#000000"/>
55+
<entity uuid="10de66e4-a8b3-44a9-a6d0-a9fd28338fe2" bg-color="#FFFFFF" hdr-color="#D2D2D2" position-x="-23" position-y="-44" size-x="0" size-x2="77" size-y="0" size-y2="45"/>
56+
<entity uuid="568a03b7-3dd5-435a-9bc8-869bc673923c" bg-color="#FFFFFF" hdr-color="#D2D2D2" position-x="-23" position-y="136" size-x="0" size-x2="93" size-y="0" size-y2="73"/>
5757
<entity uuid="8a04b312-72bb-4723-baac-75502524ae38" bg-color="#FFFFFF" hdr-color="#D2D2D2" position-x="177" position-y="-44" size-x="0" size-x2="136" size-y="0" size-y2="101"/>
5858
<entity uuid="ad470906-9e63-41e7-9558-979789bc2d28" bg-color="#FFFFFF" hdr-color="#D2D2D2" position-x="177" position-y="136" size-x="0" size-x2="122" size-y="0" size-y2="59"/>
5959
<entity uuid="e5603f71-6798-480b-bcf8-0d185a08e653" bg-color="#FFFFFF" hdr-color="#D2D2D2" position-x="77" position-y="256" size-x="0" size-x2="109" size-y="0" size-y2="60"/>
6060
<many-to-many-association uuid="e4936d0d-1d1f-4fb8-af31-fa1d0665ccf7" color="#969696"/>
61-
<module uuid="d5f257f8-d854-4bae-a05d-1ed8673c7eb5" bg-color="#E1EDF0" position-x="43" position-y="84" size-x="43" size-x2="637" size-y="84" size-y2="416"/>
62-
<project uuid="25d2b513-c6b7-4071-9ada-7c48f127f426" size-x="50" size-x2="730" size-y="50" size-y2="550"/>
61+
<module uuid="d5f257f8-d854-4bae-a05d-1ed8673c7eb5" bg-color="#E1EDF0" position-x="43" position-y="84" size-x="43" size-x2="437" size-y="84" size-y2="376"/>
62+
<project uuid="25d2b513-c6b7-4071-9ada-7c48f127f426" size-x="50" size-x2="520" size-y="50" size-y2="500"/>
6363
</visual-data>
6464
</skipper>

public/erd.png

-3.71 KB
Loading

0 commit comments

Comments
 (0)