Skip to content

Instantly share code, notes, and snippets.

[Doctrine\DBAL\Exception\UniqueConstraintViolationException]
An exception occurred while executing 'INSERT INTO user_game_stats_email (timeout_percent, avg_time_per_move, echess_game_count, unrated_game_cou
nt, in_progress_count, timeout_count, moves_per_game, total_move_time, total_move_count, tournament_count, tournament_game_win_count, tournament_
game_loss_count, tournament_game_draw_count, tournament_1st_place, tournament_2nd_place, tournament_3rd_place, tournament_host_count, tournament_
host_user_count, tournament_withdraw_count, tournament_in_progress_count, tournament_cancel_count, tournament_points, tournament_count_total, tou
rnament_points_total, tournament_count_previous, tournament_points_previous, avg_opponent_rating, rd, rating, last_date, h
@vetalt
vetalt / gist:3c7605dcae758aa8a3be
Created February 19, 2016 13:49
getLatestByCategories2
(
select
ft1.parent_category_id,
ft1.forum_topic_id,
ft1.subject,
ft1.url,
ft1.post_count,
ft1.last_forum_topic_create_date,
case when ft1.is_locked then 'locked' when tft.track_forum_topic_id is not null then 'tracked' else 'none' end as status,
if (
@vetalt
vetalt / gist:2200c0e3b3c7d61d108b
Created February 18, 2016 19:02
getLatestByCategories
(
select
ft1.parent_category_id,
ft1.forum_topic_id,
ft1.subject,
ft1.url,
ft1.post_count,
ft1.last_forum_topic_create_date,
case when ft1.is_locked then 'locked' when tft.track_forum_topic_id is not null then 'tracked' else 'none' end as status,
if (
@vetalt
vetalt / gist:1457b59840a22cc8af49
Created February 17, 2016 20:01
getLatestForCategories
select
ft1.parent_category_id,
substring_index(group_concat(ft1.forum_topic_id order by ft1.last_forum_topic_create_date desc), ',', 3) as ids
from
forum_topic ft1
join user u1 on ft1.user_id = u1.user_id
and u1.is_content_hidden = 0
join forum_topic ft2 on ft1.last_forum_topic_id = ft2.forum_topic_id
join user u2 on ft2.user_id = u2.user_id
and u2.is_content_hidden = 0
@vetalt
vetalt / phase-refactoring
Created November 17, 2014 15:38
phase refactoring
https://healthycode.atlassian.net/browse/DEV-2483
нам предстоит выполнить изменения в ядерном коде, которые затронут многие вещи.
охватить сразу всё будет нелегко, поэтому предлагаю постепенный переход в два этапа:
1) на первом этапе вводим User::track (PhaseBundle\UserTrack) и дублируем с его помощью функционал связанный с User::currentUserProgram;
2) на втором этапе избавляемся от функционала связанного с User::currentUserProgram;
для этого на первом этапе желательно оставлять в коде метки deprecated, чтоб потом было проще вычищать старый код.