У меня есть таблица в MySQL. Я обнаружил, что некоторые столбцы я не пропустил при вставке. как MySQL принимает вставку этих записей без исключения исключения?
введите здесь описание изображения
это столбцы, которые добавили к ним нулевое значение, когда я вставил строки без передачи им значения.
Это схема таблицы
Код: Выделить всё
create table if not exists ads_sliders
(
id bigint unsigned auto_increment
primary key,
name varchar(191) not null,
image varchar(191) not null,
appearance_time int default 0 null,
active tinyint(1) default 1 not null,
`default` tinyint(1) default 0 null,
first_period_sort int default 99 null,
second_period_sort int default 99 null,
third_period_sort int default 99 null,
internal_link varchar(191) null,
external_link varchar(191) null,
deleted tinyint(1) default 0 not null,
country_id char(36) not null,
created_at timestamp null,
updated_at timestamp null,
start_date date not null,
end_date date not null,
ad_appears smallint default 1 null,
display_period int unsigned not null,
repetition int unsigned not null,
display_place tinyint not null,
on_click_action tinyint not null,
data json null,
constraint ads_sliders_country_id_foreign
foreign key (country_id) references countries (id)
on delete cascade
)
collate=utf8mb4_unicode_ci;
Код: Выделить всё
insert into
`ads_sliders` (
`name`,
`image`,
`country_id`,
`end_date`,
`updated_at`,
`created_at`
)
values
(
'sadf',
'assets/images/ads_sliders/cLZVRNXf0LAP4j3IsdLImZejouAEri0grvEJxB0S.png',
'55af3f40-23e3-11e9-acdc-efd87e16b684',
'2024-04-30',
'2024-04-30 09:16:07',
'2024-04-30 09:16:07'
)
Я тестирую ее в новой схеме базы данных. и он работает правильно.
введите здесь описание изображения
Подробнее здесь: https://stackoverflow.com/questions/784 ... connection
Мобильная версия