# ===== v 4.3.9 =====

INSERT INTO ImportScripts VALUES (DEFAULT, 'Articles from CSV file [In-News]', '', 'n', 'In-News', '', 'CSV', '1');

# ===== v 5.0.0 =====
ALTER TABLE News ADD INDEX (StartDate), ADD INDEX (Archived);

UPDATE Category SET Template = '/in-news/designs/section' WHERE Template = 'innews/index';
UPDATE Category SET CachedTemplate = '/in-news/designs/section' WHERE CachedTemplate = 'innews/index';

UPDATE ConfigurationValues SET VariableValue = '/in-news/designs/section' WHERE VariableName = 'n_CategoryTemplate';
UPDATE ConfigurationValues SET VariableValue = 'in-news/designs/detail' WHERE VariableName = 'n_ItemTemplate';

INSERT INTO Permissions VALUES (DEFAULT, 'in-news:articles.view', 11, 1, 1, 0);
INSERT INTO Permissions VALUES (DEFAULT, 'in-news:setting_folder.view', 11, 1, 1, 0);
DELETE FROM Permissions WHERE Permission LIKE 'in-news:innews_general.%';

UPDATE Phrase SET Module = 'In-News' WHERE ((Phrase LIKE '%Article%' OR Phrase LIKE '%News%') AND (Module = 'Core') AND Phrase NOT IN ('la_ToolTip_NewSearchConfig', 'la_tooltip_newstylesheet'));

UPDATE Phrase SET Module = 'In-News' WHERE Phrase = 'la_title_In-News';

# ===== v 5.0.1 =====
UPDATE ConfigurationValues SET VariableValue = 'in-news/articles/article_detail' WHERE VariableName = 'n_ItemTemplate';

UPDATE ConfigurationAdmin
SET ValueList = 'ReviewText=la_opt_CommentText,CreatedOn=la_opt_CreatedOn'
WHERE VariableName IN ('News_SortReviews', 'News_SortReviews2');

UPDATE ConfigurationAdmin SET ValueList = 'ASC=la_common_Ascending,DESC=la_common_Descending'
WHERE VariableName IN ('News_SortReviewsOrder', 'News_SortReviewsOrder2');

UPDATE ConfigurationAdmin
SET ValueList = '1=la_opt_Sec,60=la_opt_Min,3600=la_opt_Hour,86400=la_opt_Day,604800=la_opt_Week,2419200=la_opt_Month,29030400=la_opt_Year'
WHERE VariableName IN ('News_ReviewDelay_Interval', 'News_RatingDelay_Interval');

UPDATE CustomField SET FieldLabel = 'la_fld_RssSource', Prompt = 'la_fld_RssSource' WHERE FieldName = 'RssSource';
UPDATE CustomField SET FieldLabel = 'la_fld_RssDefaultExpiration', Prompt = 'la_fld_RssDefaultExpiration' WHERE FieldName = 'RssDefaultExpiration';
UPDATE CustomField SET FieldLabel = 'la_fld_RssUpdateInterval', Prompt = 'la_fld_RssUpdateInterval' WHERE FieldName = 'RssUpdateInterval';
UPDATE CustomField SET FieldLabel = 'la_fld_RssExpireInterval', Prompt = 'la_fld_RssExpireInterval' WHERE FieldName = 'RssExpireInterval';
UPDATE CustomField SET FieldLabel = 'la_fld_RssDeleteExpired', Prompt = 'la_fld_RssDeleteExpired' WHERE FieldName = 'RssDeleteExpired';

UPDATE CustomField SET FieldLabel = 'la_fld_RssLastExpired', Prompt = 'la_fld_RssLastExpired' WHERE FieldName = 'RssLastExpired';
UPDATE CustomField SET FieldLabel = 'la_fld_RssDefaultExpirationType', Prompt = 'la_fld_RssDefaultExpirationType' WHERE FieldName = 'RssDefaultExpirationType';
UPDATE CustomField SET FieldLabel = 'la_fld_RssExpireIntervalType', Prompt = 'la_fld_RssExpireIntervalType' WHERE FieldName = 'RssExpireIntervalType';
UPDATE CustomField SET FieldLabel = 'la_fld_RssUpdateIntervalType', Prompt = 'la_fld_RssUpdateIntervalType' WHERE FieldName = 'RssUpdateIntervalType';
UPDATE CustomField SET FieldLabel = 'la_fld_RssLastUpdated', Prompt = 'la_fld_RssLastUpdated' WHERE FieldName = 'RssLastUpdated';
UPDATE CustomField SET FieldLabel = 'la_fld_RssArticleCRC', Prompt = 'la_fld_RssArticleCRC' WHERE FieldName = 'RssArticleCRC';
UPDATE CustomField SET FieldLabel = 'la_fld_cust_n_ItemTemplate', Prompt = 'la_fld_cust_n_ItemTemplate' WHERE FieldName = 'n_ItemTemplate';

INSERT INTO Events VALUES(DEFAULT, 'NEWS.REVIEW.ADD.PENDING', NULL, 1, 0, NULL, 'In-News', 'la_event_article.review.add.pending', 1);

UPDATE ConfigurationAdmin SET ValueList = 'style="width: 50px;"' WHERE VariableName IN ('News_ReviewDelay_Value', 'News_RatingDelay_Value');

# ===== v 5.0.2-B1 =====
ALTER TABLE News
	CHANGE CreatedOn CreatedOn INT(11) NULL DEFAULT NULL,
	CHANGE StartDate StartDate INT(11) NULL DEFAULT NULL,
	CHANGE Modified Modified INT(11) NULL DEFAULT NULL;

# ===== v 5.0.2-B2 =====

# ===== v 5.0.2-RC1 =====

# ===== v 5.0.2 =====

# ===== v 5.0.3-B1 =====

# ===== v 5.0.3-B2 =====