<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.heurekaslu.se/w/index.php?action=history&amp;feed=atom&amp;title=Heureka_database_upgrade_script_0.6.0.2</id>
	<title>Heureka database upgrade script 0.6.0.2 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.heurekaslu.se/w/index.php?action=history&amp;feed=atom&amp;title=Heureka_database_upgrade_script_0.6.0.2"/>
	<link rel="alternate" type="text/html" href="https://www.heurekaslu.se/w/index.php?title=Heureka_database_upgrade_script_0.6.0.2&amp;action=history"/>
	<updated>2026-05-05T21:21:26Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.13</generator>
	<entry>
		<id>https://www.heurekaslu.se/w/index.php?title=Heureka_database_upgrade_script_0.6.0.2&amp;diff=2786&amp;oldid=prev</id>
		<title>Peder at 14:02, 14 July 2009</title>
		<link rel="alternate" type="text/html" href="https://www.heurekaslu.se/w/index.php?title=Heureka_database_upgrade_script_0.6.0.2&amp;diff=2786&amp;oldid=prev"/>
		<updated>2009-07-14T14:02:23Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 14:02, 14 July 2009&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot; &gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Heureka database upgrade &lt;/del&gt;scripts | Back to scripts]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;:Category:Database &lt;/ins&gt;scripts | Back to scripts]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;IF (SELECT COUNT(*) FROM VERSION WHERE ApplicationVersion = '0.6.0.1') = 0&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;IF (SELECT COUNT(*) FROM VERSION WHERE ApplicationVersion = '0.6.0.1') = 0&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Peder</name></author>
	</entry>
	<entry>
		<id>https://www.heurekaslu.se/w/index.php?title=Heureka_database_upgrade_script_0.6.0.2&amp;diff=2758&amp;oldid=prev</id>
		<title>Peder at 13:38, 14 July 2009</title>
		<link rel="alternate" type="text/html" href="https://www.heurekaslu.se/w/index.php?title=Heureka_database_upgrade_script_0.6.0.2&amp;diff=2758&amp;oldid=prev"/>
		<updated>2009-07-14T13:38:26Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 13:38, 14 July 2009&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l66&quot; &gt;Line 66:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 66:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Database]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Database &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;scripts&lt;/ins&gt;]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Peder</name></author>
	</entry>
	<entry>
		<id>https://www.heurekaslu.se/w/index.php?title=Heureka_database_upgrade_script_0.6.0.2&amp;diff=2747&amp;oldid=prev</id>
		<title>Peder: New page:  Back to scripts &lt;pre&gt; IF (SELECT COUNT(*) FROM VERSION WHERE ApplicationVersion = '0.6.0.1') = 0 BEGIN 	PRINT 'Wrong Version of database. You must up...</title>
		<link rel="alternate" type="text/html" href="https://www.heurekaslu.se/w/index.php?title=Heureka_database_upgrade_script_0.6.0.2&amp;diff=2747&amp;oldid=prev"/>
		<updated>2009-07-14T12:06:43Z</updated>

		<summary type="html">&lt;p&gt;New page: &lt;a href=&quot;/w/index.php?title=Heureka_database_upgrade_scripts&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Heureka database upgrade scripts (page does not exist)&quot;&gt; Back to scripts&lt;/a&gt; &amp;lt;pre&amp;gt; IF (SELECT COUNT(*) FROM VERSION WHERE ApplicationVersion = &amp;#039;0.6.0.1&amp;#039;) = 0 BEGIN 	PRINT &amp;#039;Wrong Version of database. You must up...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Heureka database upgrade scripts | Back to scripts]]&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
IF (SELECT COUNT(*) FROM VERSION WHERE ApplicationVersion = '0.6.0.1') = 0&lt;br /&gt;
BEGIN&lt;br /&gt;
	PRINT 'Wrong Version of database. You must upgrade to version 0.6.0.1 before running this script.';&lt;br /&gt;
END&lt;br /&gt;
ELSE &lt;br /&gt;
BEGIN		&lt;br /&gt;
&lt;br /&gt;
	-- 1. Recreate Table Cliques&lt;br /&gt;
&lt;br /&gt;
	IF EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'Cliques')&lt;br /&gt;
	BEGIN&lt;br /&gt;
		DROP TABLE [dbo].[Cliques]&lt;br /&gt;
	END&lt;br /&gt;
&lt;br /&gt;
	CREATE TABLE [dbo].[Cliques](&lt;br /&gt;
		[CliqueGUID] [uniqueidentifier] NOT NULL,&lt;br /&gt;
		[AreaGUID] [uniqueidentifier] NOT NULL,&lt;br /&gt;
		[TreatmentUnitGUID] [uniqueidentifier] NOT NULL&lt;br /&gt;
	) ON [PRIMARY]&lt;br /&gt;
&lt;br /&gt;
	ALTER TABLE [dbo].[Cliques]  WITH NOCHECK ADD  CONSTRAINT [FK_Cliques_Area] FOREIGN KEY([AreaGUID])&lt;br /&gt;
	REFERENCES [dbo].[Area] ([AreaGUID])&lt;br /&gt;
&lt;br /&gt;
	ALTER TABLE [dbo].[Cliques] CHECK CONSTRAINT [FK_Cliques_Area]&lt;br /&gt;
&lt;br /&gt;
	ALTER TABLE [dbo].[Cliques]  WITH NOCHECK ADD  CONSTRAINT [FK_Cliques_TreatmentUnit] FOREIGN KEY([TreatmentUnitGUID])&lt;br /&gt;
	REFERENCES [dbo].[TreatmentUnit] ([TreatmentUnitGUID])&lt;br /&gt;
&lt;br /&gt;
	ALTER TABLE [dbo].[Cliques] CHECK CONSTRAINT [FK_Cliques_TreatmentUnit]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	-- 2. Recreate Table HarvestClusters&lt;br /&gt;
&lt;br /&gt;
	IF EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 'HarvestClusters')&lt;br /&gt;
	BEGIN&lt;br /&gt;
		DROP TABLE [dbo].[HarvestClusters]&lt;br /&gt;
	END&lt;br /&gt;
&lt;br /&gt;
	CREATE TABLE [dbo].[HarvestClusters](&lt;br /&gt;
		[HarvestClusterGUID] [uniqueidentifier] NOT NULL,&lt;br /&gt;
		[AreaGUID] [uniqueidentifier] NOT NULL,&lt;br /&gt;
		[TreatmentUnitGUID] [uniqueidentifier] NOT NULL&lt;br /&gt;
	) ON [PRIMARY]&lt;br /&gt;
&lt;br /&gt;
	ALTER TABLE [dbo].[HarvestClusters]  WITH NOCHECK ADD  CONSTRAINT [FK_HarvestClusters_Area] FOREIGN KEY([AreaGUID])&lt;br /&gt;
	REFERENCES [dbo].[Area] ([AreaGUID])&lt;br /&gt;
&lt;br /&gt;
	ALTER TABLE [dbo].[HarvestClusters] CHECK CONSTRAINT [FK_HarvestClusters_Area]&lt;br /&gt;
&lt;br /&gt;
	ALTER TABLE [dbo].[HarvestClusters]  WITH NOCHECK ADD  CONSTRAINT [FK_HarvestClusters_TreatmentUnit] FOREIGN KEY([TreatmentUnitGUID])&lt;br /&gt;
	REFERENCES [dbo].[TreatmentUnit] ([TreatmentUnitGUID])&lt;br /&gt;
&lt;br /&gt;
	ALTER TABLE [dbo].[HarvestClusters] CHECK CONSTRAINT [FK_HarvestClusters_TreatmentUnit]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	-- Update Version Table&lt;br /&gt;
&lt;br /&gt;
	UPDATE Version SET ApplicationVersion = '0.6.0.2';&lt;br /&gt;
&lt;br /&gt;
	PRINT 'Success! Database upgrade to version 0.6.0.2';&lt;br /&gt;
END&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[Category:Database]]&lt;/div&gt;</summary>
		<author><name>Peder</name></author>
	</entry>
</feed>