sql query in cms_block table in magento 2
I have to write insert query for Magento 2 cms_block
table,
for ex:- cms_block
table, what should i write for the column created_in
, updated_in
, creation_time
, update_time
row_id block_id created_in updated_in title identifier content
254 254 1 2147483647 Designer designer "<p><span></span></p>"
creation_time update_time is_active
2018-08-21 00:21:47 2018-09-18 01:00:07 1
These are the entries which are already there in cms_block
, I have to create a msyql script insert queries so that i can run it on mysql console.
What does created_in = 1
mean? similarly what is updated_in= 2147483647
mean
looking at their data types they are bigint(20) unsigned
.
for creation_time
and update_time
i will use timestamp, but what to use for created_in
and updated_in
in my sql query.
And if there is another approach to achieve that,
I looked on this link:-
Magento 2: How to insert data into custom table in model file?
But my requirement is to run insert query on the MySQL terminal for
Magento 2, and for that, I don't the meaning of two columns created_in, updated_in and if that's epoc time then how to do that in MySQL query
UPDATE
WHEN I MANUALLY INSERT VALUE FOR ALL COLUMNS , following error occurs
ERROR 1452 (23000): Cannot add or update a child row: a foreign key constraint fails (`webster`.`cms_block`, CONSTRAINT `CMS_BLOCK_BLOCK_ID_SEQUENCE_CMS_BLOCK_SEQUENCE_VALUE` FOREIGN KEY (`block_id`) REFERENCES `sequence_cms_block` (`sequence_value`) ON DELETE CASCADE)
magento2 database cms-block
add a comment |
I have to write insert query for Magento 2 cms_block
table,
for ex:- cms_block
table, what should i write for the column created_in
, updated_in
, creation_time
, update_time
row_id block_id created_in updated_in title identifier content
254 254 1 2147483647 Designer designer "<p><span></span></p>"
creation_time update_time is_active
2018-08-21 00:21:47 2018-09-18 01:00:07 1
These are the entries which are already there in cms_block
, I have to create a msyql script insert queries so that i can run it on mysql console.
What does created_in = 1
mean? similarly what is updated_in= 2147483647
mean
looking at their data types they are bigint(20) unsigned
.
for creation_time
and update_time
i will use timestamp, but what to use for created_in
and updated_in
in my sql query.
And if there is another approach to achieve that,
I looked on this link:-
Magento 2: How to insert data into custom table in model file?
But my requirement is to run insert query on the MySQL terminal for
Magento 2, and for that, I don't the meaning of two columns created_in, updated_in and if that's epoc time then how to do that in MySQL query
UPDATE
WHEN I MANUALLY INSERT VALUE FOR ALL COLUMNS , following error occurs
ERROR 1452 (23000): Cannot add or update a child row: a foreign key constraint fails (`webster`.`cms_block`, CONSTRAINT `CMS_BLOCK_BLOCK_ID_SEQUENCE_CMS_BLOCK_SEQUENCE_VALUE` FOREIGN KEY (`block_id`) REFERENCES `sequence_cms_block` (`sequence_value`) ON DELETE CASCADE)
magento2 database cms-block
add a comment |
I have to write insert query for Magento 2 cms_block
table,
for ex:- cms_block
table, what should i write for the column created_in
, updated_in
, creation_time
, update_time
row_id block_id created_in updated_in title identifier content
254 254 1 2147483647 Designer designer "<p><span></span></p>"
creation_time update_time is_active
2018-08-21 00:21:47 2018-09-18 01:00:07 1
These are the entries which are already there in cms_block
, I have to create a msyql script insert queries so that i can run it on mysql console.
What does created_in = 1
mean? similarly what is updated_in= 2147483647
mean
looking at their data types they are bigint(20) unsigned
.
for creation_time
and update_time
i will use timestamp, but what to use for created_in
and updated_in
in my sql query.
And if there is another approach to achieve that,
I looked on this link:-
Magento 2: How to insert data into custom table in model file?
But my requirement is to run insert query on the MySQL terminal for
Magento 2, and for that, I don't the meaning of two columns created_in, updated_in and if that's epoc time then how to do that in MySQL query
UPDATE
WHEN I MANUALLY INSERT VALUE FOR ALL COLUMNS , following error occurs
ERROR 1452 (23000): Cannot add or update a child row: a foreign key constraint fails (`webster`.`cms_block`, CONSTRAINT `CMS_BLOCK_BLOCK_ID_SEQUENCE_CMS_BLOCK_SEQUENCE_VALUE` FOREIGN KEY (`block_id`) REFERENCES `sequence_cms_block` (`sequence_value`) ON DELETE CASCADE)
magento2 database cms-block
I have to write insert query for Magento 2 cms_block
table,
for ex:- cms_block
table, what should i write for the column created_in
, updated_in
, creation_time
, update_time
row_id block_id created_in updated_in title identifier content
254 254 1 2147483647 Designer designer "<p><span></span></p>"
creation_time update_time is_active
2018-08-21 00:21:47 2018-09-18 01:00:07 1
These are the entries which are already there in cms_block
, I have to create a msyql script insert queries so that i can run it on mysql console.
What does created_in = 1
mean? similarly what is updated_in= 2147483647
mean
looking at their data types they are bigint(20) unsigned
.
for creation_time
and update_time
i will use timestamp, but what to use for created_in
and updated_in
in my sql query.
And if there is another approach to achieve that,
I looked on this link:-
Magento 2: How to insert data into custom table in model file?
But my requirement is to run insert query on the MySQL terminal for
Magento 2, and for that, I don't the meaning of two columns created_in, updated_in and if that's epoc time then how to do that in MySQL query
UPDATE
WHEN I MANUALLY INSERT VALUE FOR ALL COLUMNS , following error occurs
ERROR 1452 (23000): Cannot add or update a child row: a foreign key constraint fails (`webster`.`cms_block`, CONSTRAINT `CMS_BLOCK_BLOCK_ID_SEQUENCE_CMS_BLOCK_SEQUENCE_VALUE` FOREIGN KEY (`block_id`) REFERENCES `sequence_cms_block` (`sequence_value`) ON DELETE CASCADE)
magento2 database cms-block
magento2 database cms-block
edited yesterday
suman
asked 2 days ago
sumansuman
133
133
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
created_in
and updated_in
are used for scheduled updates (EE-only feature)
https://devdocs.magento.com/guides/v2.3/mrg/ee/CmsStaging.html
creation_time
and update_time
have a default value (which is the current time) that will be set by mysql if you don't provide anything specific.
it gives me error in block_id column, ERROR 1364 (HY000): Field 'block_id' doesn't have a default value, row_id and block_id 'id' are same, how can i know what value to insert in block_id
– suman
yesterday
and it also throw error forcreated_in
andupdated_in
, ERROR 1364 (HY000): Field 'created_in' doesn't have a default value
– suman
yesterday
you have to give values for both. created_in is useally 1 and block id is the block id
– Philipp Sander
yesterday
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "479"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f257145%2fsql-query-in-cms-block-table-in-magento-2%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
created_in
and updated_in
are used for scheduled updates (EE-only feature)
https://devdocs.magento.com/guides/v2.3/mrg/ee/CmsStaging.html
creation_time
and update_time
have a default value (which is the current time) that will be set by mysql if you don't provide anything specific.
it gives me error in block_id column, ERROR 1364 (HY000): Field 'block_id' doesn't have a default value, row_id and block_id 'id' are same, how can i know what value to insert in block_id
– suman
yesterday
and it also throw error forcreated_in
andupdated_in
, ERROR 1364 (HY000): Field 'created_in' doesn't have a default value
– suman
yesterday
you have to give values for both. created_in is useally 1 and block id is the block id
– Philipp Sander
yesterday
add a comment |
created_in
and updated_in
are used for scheduled updates (EE-only feature)
https://devdocs.magento.com/guides/v2.3/mrg/ee/CmsStaging.html
creation_time
and update_time
have a default value (which is the current time) that will be set by mysql if you don't provide anything specific.
it gives me error in block_id column, ERROR 1364 (HY000): Field 'block_id' doesn't have a default value, row_id and block_id 'id' are same, how can i know what value to insert in block_id
– suman
yesterday
and it also throw error forcreated_in
andupdated_in
, ERROR 1364 (HY000): Field 'created_in' doesn't have a default value
– suman
yesterday
you have to give values for both. created_in is useally 1 and block id is the block id
– Philipp Sander
yesterday
add a comment |
created_in
and updated_in
are used for scheduled updates (EE-only feature)
https://devdocs.magento.com/guides/v2.3/mrg/ee/CmsStaging.html
creation_time
and update_time
have a default value (which is the current time) that will be set by mysql if you don't provide anything specific.
created_in
and updated_in
are used for scheduled updates (EE-only feature)
https://devdocs.magento.com/guides/v2.3/mrg/ee/CmsStaging.html
creation_time
and update_time
have a default value (which is the current time) that will be set by mysql if you don't provide anything specific.
edited 2 days ago
answered 2 days ago
Philipp SanderPhilipp Sander
3661319
3661319
it gives me error in block_id column, ERROR 1364 (HY000): Field 'block_id' doesn't have a default value, row_id and block_id 'id' are same, how can i know what value to insert in block_id
– suman
yesterday
and it also throw error forcreated_in
andupdated_in
, ERROR 1364 (HY000): Field 'created_in' doesn't have a default value
– suman
yesterday
you have to give values for both. created_in is useally 1 and block id is the block id
– Philipp Sander
yesterday
add a comment |
it gives me error in block_id column, ERROR 1364 (HY000): Field 'block_id' doesn't have a default value, row_id and block_id 'id' are same, how can i know what value to insert in block_id
– suman
yesterday
and it also throw error forcreated_in
andupdated_in
, ERROR 1364 (HY000): Field 'created_in' doesn't have a default value
– suman
yesterday
you have to give values for both. created_in is useally 1 and block id is the block id
– Philipp Sander
yesterday
it gives me error in block_id column, ERROR 1364 (HY000): Field 'block_id' doesn't have a default value, row_id and block_id 'id' are same, how can i know what value to insert in block_id
– suman
yesterday
it gives me error in block_id column, ERROR 1364 (HY000): Field 'block_id' doesn't have a default value, row_id and block_id 'id' are same, how can i know what value to insert in block_id
– suman
yesterday
and it also throw error for
created_in
and updated_in
, ERROR 1364 (HY000): Field 'created_in' doesn't have a default value– suman
yesterday
and it also throw error for
created_in
and updated_in
, ERROR 1364 (HY000): Field 'created_in' doesn't have a default value– suman
yesterday
you have to give values for both. created_in is useally 1 and block id is the block id
– Philipp Sander
yesterday
you have to give values for both. created_in is useally 1 and block id is the block id
– Philipp Sander
yesterday
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f257145%2fsql-query-in-cms-block-table-in-magento-2%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown