Merged in feature_magnetico_go_postgres (pull request #28)

Using PostgreSQL for magneticod (Go) back-end.
This commit is contained in:
Alexey Eschenko 2019-10-20 12:53:28 +00:00
commit 5a87ae6476
4 changed files with 6 additions and 7 deletions

2
.env
View file

@ -14,7 +14,7 @@ APP_SECRET=xxx
# For an SQLite database, use: "sqlite:///%kernel.project_dir%/var/data.db"
# Configure your db driver and server_version in config/packages/doctrine.yaml
APP_DATABASE_URL=postgres://$PGUSER:$PGPASSWORD@127.0.0.1:5436/test?application_name=magnetico_web
MAGNETICOD_DATABASE_URL=sqlite:///%kernel.project_dir%/tests/database/database.sqlite3
MAGNETICOD_DATABASE_URL=postgres://$PGUSER:$PGPASSWORD@127.0.0.1:5436/test?application_name=magnetico_web
###< doctrine/doctrine-bundle ###
###> sentry/sentry-symfony ###

View file

@ -15,7 +15,7 @@ doctrine:
url: '%env(resolve:APP_DATABASE_URL)%'
#server_version: 9.6
magneticod:
driver: 'pdo_sqlite'
driver: 'pdo_pgsql'
url: '%env(resolve:MAGNETICOD_DATABASE_URL)%'
orm:
auto_generate_proxy_classes: '%kernel.debug%'
@ -41,4 +41,3 @@ doctrine:
dir: '%kernel.project_dir%/src/Magnetico/Entity'
prefix: 'App\Magnetico'
alias: Magnetico

View file

@ -6,7 +6,7 @@ use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation as Serializer;
/**
* @ORM\Table(name="files", indexes={
* @ORM\Table(schema="magneticod", name="files", indexes={
* @ORM\Index(name="file_info_hash_index", columns={"torrent_id"})
* })
* @ORM\Entity(readOnly=true)
@ -34,7 +34,7 @@ class File
*
* @Serializer\Groups({"api_v1_show"})
*
* @ORM\Column(name="size", type="integer", nullable=false)
* @ORM\Column(name="size", type="bigint", nullable=false)
*/
private $size;

View file

@ -7,7 +7,7 @@ use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation as Serializer;
/**
* @ORM\Table(name="torrents", indexes={
* @ORM\Table(schema="magneticod", name="torrents", indexes={
* @ORM\Index(name="discovered_on_index", columns={"discovered_on"}),
* @ORM\Index(name="info_hash_index", columns={"info_hash"})
* })
@ -53,7 +53,7 @@ class Torrent
*
* @Serializer\Groups({"api_v1_search", "api_v1_show"})
*
* @ORM\Column(name="total_size", type="integer", nullable=false)
* @ORM\Column(name="total_size", type="bigint", nullable=false)
*/
private $totalSize;