1
0
mirror of https://github.com/cydrobolt/polr.git synced 2024-11-09 11:42:28 +01:00

Changed code style.

This commit is contained in:
feuzeu 2017-12-05 18:49:00 -05:00
parent 9206330fa0
commit 828d68d1ad
2 changed files with 5 additions and 3 deletions

View File

@ -52,7 +52,8 @@ class StatsHelper {
$db_driver = DB::connection()->getDriverName();
if ($db_driver == 'pgsql') {
$created_at = "to_char(created_at, 'yyyy-mm-dd')";
} else {
}
else {
$created_at = "DATE_FORMAT(created_at, '%Y-%m-%d')";
}

View File

@ -16,11 +16,12 @@ class AlterLinkClicksToInteger extends Migration
{
// Execute raw SQL statements on PostgreSQL
$db_driver = DB::connection()->getDriverName();
if ($db_driver == 'pgsql') {
if($db_driver == 'pgsql') {
DB::statement('ALTER TABLE links ALTER COLUMN clicks DROP DEFAULT');
DB::statement('ALTER TABLE links ALTER COLUMN clicks TYPE INT USING (clicks::INT)');
DB::statement('ALTER TABLE links ALTER COLUMN clicks SET DEFAULT 0');
} else {
}
else {
Schema::table('links', function (Blueprint $table)
{
$table->integer('clicks')->change();