Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3e492475c0 | |||
| c454e85ad4 | |||
| 487322abb5 |
@@ -8,6 +8,7 @@ use App\Models\Transaction;
|
|||||||
use Database\Seeders\CurrencySeeder;
|
use Database\Seeders\CurrencySeeder;
|
||||||
use Database\Seeders\MarketDataSeeder;
|
use Database\Seeders\MarketDataSeeder;
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Query\Expression;
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
use Illuminate\Support\Facades\Artisan;
|
use Illuminate\Support\Facades\Artisan;
|
||||||
use Illuminate\Support\Facades\DB;
|
use Illuminate\Support\Facades\DB;
|
||||||
@@ -24,10 +25,15 @@ return new class extends Migration
|
|||||||
* Add options column to users table
|
* Add options column to users table
|
||||||
*/
|
*/
|
||||||
Schema::table('users', function (Blueprint $table) {
|
Schema::table('users', function (Blueprint $table) {
|
||||||
$table->json('options')->default(json_encode([
|
|
||||||
'locale' => config('app.locale', 'en'),
|
$locale = config('app.locale', 'en');
|
||||||
'display_currency' => config('investbrain.base_currency', 'USD'),
|
$currency = config('investbrain.base_currency', 'USD');
|
||||||
]))->after('profile_photo_path');
|
|
||||||
|
$default = config('database.default') === 'mysql'
|
||||||
|
? new Expression("(JSON_OBJECT('locale', '{$locale}', 'display_currency', '{$currency}'))")
|
||||||
|
: json_encode(['locale' => $locale, 'display_currency' => $currency]);
|
||||||
|
|
||||||
|
$table->json('options')->default($default)->after('profile_photo_path');
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
+1
-1
@@ -62,7 +62,7 @@ RUN apk add --no-cache \
|
|||||||
bash \
|
bash \
|
||||||
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
|
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
|
||||||
&& docker-php-ext-install -j$(nproc) \
|
&& docker-php-ext-install -j$(nproc) \
|
||||||
gd pgsql zip pdo_mysql mysqli intl
|
gd pgsql zip pdo_mysql pdo_pgsql mysqli intl
|
||||||
|
|
||||||
# Remove default nginx config
|
# Remove default nginx config
|
||||||
RUN rm -rf /var/www/html \
|
RUN rm -rf /var/www/html \
|
||||||
|
|||||||
@@ -221,7 +221,7 @@ class DailyChangeTest extends TestCase
|
|||||||
$second_transaction = Transaction::create([
|
$second_transaction = Transaction::create([
|
||||||
'symbol' => 'AAPL',
|
'symbol' => 'AAPL',
|
||||||
'portfolio_id' => $portfolio->id,
|
'portfolio_id' => $portfolio->id,
|
||||||
'date' => now()->subYears(3),
|
'date' => now()->subDays(1080), // 3 years
|
||||||
'quantity' => 1,
|
'quantity' => 1,
|
||||||
'cost_basis' => 39.89,
|
'cost_basis' => 39.89,
|
||||||
'transaction_type' => 'BUY',
|
'transaction_type' => 'BUY',
|
||||||
|
|||||||
Reference in New Issue
Block a user