]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
восстановление файлов
authorJoySystem_v <fvv2011@gmail.com>
Mon, 26 Aug 2024 09:36:53 +0000 (12:36 +0300)
committerJoySystem_v <fvv2011@gmail.com>
Mon, 26 Aug 2024 09:36:53 +0000 (12:36 +0300)
docker/db/dev.db-pgsql.env [new file with mode: 0644]
erp24/config/db.php [new file with mode: 0644]

diff --git a/docker/db/dev.db-pgsql.env b/docker/db/dev.db-pgsql.env
new file mode 100644 (file)
index 0000000..f6c696d
--- /dev/null
@@ -0,0 +1,8 @@
+POSTGRES_USER=root
+POSTGRES_PASSWORD=root
+PGADMIN_DEFAULT_EMAIL=admin@admin.com
+PGADMIN_DEFAULT_PASSWORD=admin
+POSTGRES_DB=erp24
+POSTGRES_HOSTNAME=db-pgsql-yii_erp24
+POSTGRES_PORT=5432
+POSTGRES_SCHEMA=erp24
\ No newline at end of file
diff --git a/erp24/config/db.php b/erp24/config/db.php
new file mode 100644 (file)
index 0000000..1e278e4
--- /dev/null
@@ -0,0 +1,38 @@
+<?php
+
+return 1 == 1 ? [
+    'class' => yii\db\Connection::class,
+    'dsn' => strtr('pgsql:host={host};port={port};dbname={dbname}', [
+        '{host}' => getenv('POSTGRES_HOSTNAME') ?: '127.0.0.1',
+        '{port}' => getenv('POSTGRES_PORT') ?: 5432,
+        '{dbname}' => getenv('POSTGRES_SCHEMA') ?: 'erp24',
+    ]),
+    'username' => getenv('POSTGRES_USER') ?: 'bazacvetov24',
+    'password' => getenv('POSTGRES_PASSWORD') ?: 'JVJruro_Xdg456o3ir',
+    'schemaMap' => [
+        'pgsql' => [
+            'class' => 'yii\db\pgsql\Schema',
+            'defaultSchema' => 'erp24' //specify your schema here, public is the default schema
+        ]
+    ], // PostgreSQL
+//    'charset' => 'utf8',
+//    'enableSchemaCache' => true,
+//    'schemaCacheDuration' => 300,
+]: [
+    'class' => yii\db\Connection::class,
+    'dsn' => strtr('mysql:host={host};port={port};dbname={dbname}', [
+        '{host}' => getenv('DB_HOST') ?: '127.0.0.1',
+        '{port}' => getenv('DB_PORT') ?: 3306,
+        '{dbname}' => getenv('DB_SCHEMA') ?: 'erp24',
+    ]),
+    'username' => getenv('DB_USER') ?: 'bazacvetov24',
+    'password' => getenv('DB_PASSWORD') ?: 'JVJruro_Xdg456o3ir',
+    'charset' => 'utf8',
+    'enableSchemaCache' => true,
+    'schemaCacheDuration' => 300,
+
+    // Schema cache options (for production environment)
+    //'enableSchemaCache' => true,
+    //'schemaCacheDuration' => 60,
+    //'schemaCache' => 'cache',
+];