ORIENT/scripts/post.sql

19 lines
1.2 KiB
MySQL
Raw Normal View History

ALTER TABLE `rainlab_blog_posts` CHANGE `title` `title` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL, CHANGE `slug` `slug` VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL;
INSERT INTO orient.rainlab_blog_posts (user_id,title,slug,excerpt,content_html,published_at,published,created_at,updated_at,locale,id_en)
SELECT post_author,post_title,post_name,post_excerpt,post_content,post_date,1,post_date,post_modified,'en',id from orient_wordpress.arient_2_posts;
UPDATE rainlab_blog_posts SET powerseo_title = title, powerseo_description = excerpt, powerseo_robot_index = 'index', powerseo_robot_follow = 'nofollow';
//////// angliski postlarda 2019dan ashakdaky materiallar pozulan
Delete FROM arient_2_posts_temp WHERE post_date <'2019-01-01'
////////////////////////////////insert featured images
UPDATE rainlab_blog_posts rb
inner join iatm_2_postmeta ip on rb.id_en = ip.post_id and ip.meta_key='-thumbnail_id'
inner join arient_2_posts_temp wp on wp.ID = ip.meta_value
set rb.featerd_image = wp.guid
////////////// replace image address
UPDATE rainlab_blog_posts set featured_image = REPLACE(featured_image,'https://orient.tm/en/wp-content/','') where featured_image !=''