Тёмный

Laravel Truncate DB Table: 2 Ways to Avoid Errors 

Laravel Daily
Подписаться 144 тыс.
Просмотров 3,1 тыс.
50% 1

Опубликовано:

 

10 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 21   
@SimonGe25
@SimonGe25 Год назад
Wouldn't the best solution be to set up on your game migration an onDelete effect ? Like cascade ? I'm making the assumption that truncate would work in that case though. Otherwise it feels like a hack because of the migration are not 'good enough'.
@LaravelDaily
@LaravelDaily Год назад
Also an option, yes.
@adarshchacko6137
@adarshchacko6137 Год назад
Brilliant... This information is going to come in handy.
@AMoktar
@AMoktar Год назад
You are the best ❤
@GergelyCsermely
@GergelyCsermely Год назад
Thanks!
@sebastianrojas8572
@sebastianrojas8572 Год назад
good video! Random question...Do you have any recommendation of a Laravel book? Thank you Polivas!!
@LaravelDaily
@LaravelDaily Год назад
I don't read dev books anymore, sorry, no recommendations from me :)
@recreateftv
@recreateftv Год назад
Hi Povilas, where is the best place to stay update with Laravel trick and update (ex. the last update in Laravel 11), where I can learn? Thanks
@LaravelDaily
@LaravelDaily Год назад
Sibscri to my channel and watch daily videos :) also laraveldaily.com on top has a free newsletter link, I am sending all the news there
@allanchongwe1411
@allanchongwe1411 Год назад
Hi Povilas. I have a project where I am making use of this feature (disabling and enabling FK checks) in the code. I still feel its not the best way or not safe. Once you disable the check, the entire DB is affected meaning the foreign key constraint can be violated somewhere in the database (since the checking is disabled). It would've been better if we could disable the check on specific table(s) and not at DB level. I haven't explored this yet but it would be nice to have this e.g. passing table(s) name as arguments
@LaravelDaily
@LaravelDaily Год назад
I don't think there's a feature for that, but you can suggest ir on Github with a Pull Request.
@MichalKuzmicki
@MichalKuzmicki Год назад
Could you also do the disable foreign key constraints and truncate with data still in the games table?
@LaravelDaily
@LaravelDaily Год назад
Haven't tried, but I guess the answer is yes.
@ConstAxer
@ConstAxer Год назад
Is it really related to Laravel? I think it's a sql issue.
@iedi3
@iedi3 Год назад
if you work with Laravel you should also understand the DB
@stefanbogdanovic590
@stefanbogdanovic590 Год назад
I use truncate always in testing.
@1337kaas
@1337kaas Год назад
I accidentally in prod
@stefanbogdanovic590
@stefanbogdanovic590 Год назад
@@1337kaas hahaha RIP brother, hope you have made a backup before disaster
@1337kaas
@1337kaas Год назад
@@stefanbogdanovic590 Yes only a few hours of downtime lol Shit happens
Далее
Eloquent: Two HUGE Performance Mistakes
6:37
Просмотров 8 тыс.
Laravel eCommerce SEO Management - Overview
12:36
ДОКАЗАЛ ЧТО НЕ КАБЛУК #shorts
00:30
Apple Event - September 9
1:38:50
Просмотров 25 млн
АХХАХАХАХАХАХАХАХ
00:16
Просмотров 185 тыс.
OWASP Part 8. Insecure Deserialization
1:17:11
Dev Jobs are being taken. But not by AI.
5:08
Просмотров 41 тыс.
Taylor needs our help with Laravel
4:57
Просмотров 9 тыс.
Complex Seeder: Eloquent Optimization Example
8:20
Просмотров 2,8 тыс.
A Real-Life Story About Hiring Juniors
4:11
Просмотров 3,7 тыс.
12 Laravel/PHP Tips in 8 Minutes: August 2024
8:36
Просмотров 5 тыс.
Bro, do you even TDD?
3:27
Просмотров 3,2 тыс.