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:
parent
9206330fa0
commit
828d68d1ad
@ -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')";
|
||||
}
|
||||
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user