<?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.5.3</id>
	<title>Heureka database upgrade script 0.5.3 - 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.5.3"/>
	<link rel="alternate" type="text/html" href="https://www.heurekaslu.se/w/index.php?title=Heureka_database_upgrade_script_0.5.3&amp;action=history"/>
	<updated>2026-11-08T09:01:44Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://www.heurekaslu.se/w/index.php?title=Heureka_database_upgrade_script_0.5.3&amp;diff=2776&amp;oldid=prev</id>
		<title>Peder at 13:49, 14 July 2009</title>
		<link rel="alternate" type="text/html" href="https://www.heurekaslu.se/w/index.php?title=Heureka_database_upgrade_script_0.5.3&amp;diff=2776&amp;oldid=prev"/>
		<updated>2009-07-14T13:49:24Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&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:49, 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=&quot;diff-marker&quot; data-marker=&quot;−&quot;&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 style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Heureka database upgrade &lt;/del&gt;scripts | Back to scripts]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&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 style=&quot;font-weight: bold; text-decoration: none;&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 colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&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;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&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=&quot;diff-marker&quot;&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=&quot;diff-marker&quot;&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 = &amp;#039;0.5.2.1&amp;#039; OR ApplicationVersion = &amp;#039;0.5.3&amp;#039; ) = 0&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&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 = &amp;#039;0.5.2.1&amp;#039; OR ApplicationVersion = &amp;#039;0.5.3&amp;#039; ) = 0&lt;/div&gt;&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-l118&quot;&gt;Line 118:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 119:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&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=&quot;diff-marker&quot;&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=&quot;diff-marker&quot;&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;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&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;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&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=&quot;diff-marker&quot; data-marker=&quot;+&quot;&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 style=&quot;font-weight: bold; text-decoration: none;&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.5.3&amp;diff=1681&amp;oldid=prev</id>
		<title>Cawa2: New page:  Back to scripts &lt;pre&gt; IF (SELECT COUNT(*) FROM VERSION WHERE ApplicationVersion = &#039;0.5.2.1&#039; OR ApplicationVersion = &#039;0.5.3&#039; ) = 0 BEGIN 	PRINT &#039;Wrong...</title>
		<link rel="alternate" type="text/html" href="https://www.heurekaslu.se/w/index.php?title=Heureka_database_upgrade_script_0.5.3&amp;diff=1681&amp;oldid=prev"/>
		<updated>2009-04-28T12:35:52Z</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.5.2.1&amp;#039; OR ApplicationVersion = &amp;#039;0.5.3&amp;#039; ) = 0 BEGIN 	PRINT &amp;#039;Wrong...&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 = &amp;#039;0.5.2.1&amp;#039; OR ApplicationVersion = &amp;#039;0.5.3&amp;#039; ) = 0&lt;br /&gt;
BEGIN&lt;br /&gt;
	PRINT &amp;#039;Wrong Version of database. You must upgrade to version 0.5.2.1 before running this script.&amp;#039;;&lt;br /&gt;
	SELECT ApplicationVersion FROM VERSION;&lt;br /&gt;
END&lt;br /&gt;
ELSE &lt;br /&gt;
BEGIN		&lt;br /&gt;
		-- 1. Rename columns in StandObject&lt;br /&gt;
&lt;br /&gt;
		IF EXISTS (SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = &amp;#039;StandObject&amp;#039; AND COLUMN_NAME = &amp;#039;ProportionPine&amp;#039;)&lt;br /&gt;
		BEGIN&lt;br /&gt;
			exec sp_rename &amp;#039;StandObject.ProportionPine&amp;#039;, &amp;#039;Proportion_Pine&amp;#039;, &amp;#039;COLUMN&amp;#039;;&lt;br /&gt;
			exec sp_rename &amp;#039;StandObject.ProportionSpruce&amp;#039;, &amp;#039;Proportion_Spruce&amp;#039;, &amp;#039;COLUMN&amp;#039;;&lt;br /&gt;
			exec sp_rename &amp;#039;StandObject.ProportionBirch&amp;#039;, &amp;#039;Proportion_Birch&amp;#039;, &amp;#039;COLUMN&amp;#039;;&lt;br /&gt;
			exec sp_rename &amp;#039;StandObject.ProportionAspen&amp;#039;, &amp;#039;Proportion_Aspen&amp;#039;, &amp;#039;COLUMN&amp;#039;;&lt;br /&gt;
			exec sp_rename &amp;#039;StandObject.ProportionOak&amp;#039;, &amp;#039;Proportion_Oak&amp;#039;, &amp;#039;COLUMN&amp;#039;;&lt;br /&gt;
			exec sp_rename &amp;#039;StandObject.ProportionBeech&amp;#039;, &amp;#039;Proportion_Beech&amp;#039;, &amp;#039;COLUMN&amp;#039;;&lt;br /&gt;
			exec sp_rename &amp;#039;StandObject.ProportionDeciduous&amp;#039;, &amp;#039;Proportion_Deciduous&amp;#039;, &amp;#039;COLUMN&amp;#039;;&lt;br /&gt;
			exec sp_rename &amp;#039;StandObject.ProportionContorta&amp;#039;, &amp;#039;Proportion_Contorta&amp;#039;, &amp;#039;COLUMN&amp;#039;;&lt;br /&gt;
			exec sp_rename &amp;#039;StandObject.ProportionBroadleaf&amp;#039;, &amp;#039;Proportion_Broadleaf&amp;#039;, &amp;#039;COLUMN&amp;#039;;&lt;br /&gt;
			&lt;br /&gt;
			exec sp_rename &amp;#039;StandObject.QuadraticMeanDiameterPine&amp;#039;, &amp;#039;QuadraticMeanDiameter_Pine&amp;#039;, &amp;#039;COLUMN&amp;#039;;&lt;br /&gt;
			exec sp_rename &amp;#039;StandObject.QuadraticMeanDiameterSpruce&amp;#039;, &amp;#039;QuadraticMeanDiameter_Spruce&amp;#039;, &amp;#039;COLUMN&amp;#039;;&lt;br /&gt;
			exec sp_rename &amp;#039;StandObject.QuadraticMeanDiameterBirch&amp;#039;, &amp;#039;QuadraticMeanDiameter_Birch&amp;#039;, &amp;#039;COLUMN&amp;#039;;&lt;br /&gt;
			exec sp_rename &amp;#039;StandObject.QuadraticMeanDiameterAspen&amp;#039;, &amp;#039;QuadraticMeanDiameter_Aspen&amp;#039;, &amp;#039;COLUMN&amp;#039;;&lt;br /&gt;
			exec sp_rename &amp;#039;StandObject.QuadraticMeanDiameterOak&amp;#039;, &amp;#039;QuadraticMeanDiameter_Oak&amp;#039;, &amp;#039;COLUMN&amp;#039;;&lt;br /&gt;
			exec sp_rename &amp;#039;StandObject.QuadraticMeanDiameterBeech&amp;#039;, &amp;#039;QuadraticMeanDiameter_Beech&amp;#039;, &amp;#039;COLUMN&amp;#039;;&lt;br /&gt;
			exec sp_rename &amp;#039;StandObject.QuadraticMeanDiameterDeciduous&amp;#039;, &amp;#039;QuadraticMeanDiameter_Deciduous&amp;#039;, &amp;#039;COLUMN&amp;#039;;&lt;br /&gt;
			exec sp_rename &amp;#039;StandObject.QuadraticMeanDiameterContorta&amp;#039;, &amp;#039;QuadraticMeanDiameter_Contorta&amp;#039;, &amp;#039;COLUMN&amp;#039;;&lt;br /&gt;
			exec sp_rename &amp;#039;StandObject.QuadraticMeanDiameterBroadleaf&amp;#039;, &amp;#039;QuadraticMeanDiameter_Broadleaf&amp;#039;, &amp;#039;COLUMN&amp;#039;;&lt;br /&gt;
&lt;br /&gt;
			exec sp_rename &amp;#039;StandObject.MeanDiameterPine&amp;#039;, &amp;#039;MeanDiameter_Pine&amp;#039;, &amp;#039;COLUMN&amp;#039;;&lt;br /&gt;
			exec sp_rename &amp;#039;StandObject.MeanDiameterSpruce&amp;#039;, &amp;#039;MeanDiameter_Spruce&amp;#039;, &amp;#039;COLUMN&amp;#039;;&lt;br /&gt;
			exec sp_rename &amp;#039;StandObject.MeanDiameterBirch&amp;#039;, &amp;#039;MeanDiameter_Birch&amp;#039;, &amp;#039;COLUMN&amp;#039;;&lt;br /&gt;
			exec sp_rename &amp;#039;StandObject.MeanDiameterAspen&amp;#039;, &amp;#039;MeanDiameter_Aspen&amp;#039;, &amp;#039;COLUMN&amp;#039;;&lt;br /&gt;
			exec sp_rename &amp;#039;StandObject.MeanDiameterOak&amp;#039;, &amp;#039;MeanDiameter_Oak&amp;#039;, &amp;#039;COLUMN&amp;#039;;&lt;br /&gt;
			exec sp_rename &amp;#039;StandObject.MeanDiameterBeech&amp;#039;, &amp;#039;MeanDiameter_Beech&amp;#039;, &amp;#039;COLUMN&amp;#039;;&lt;br /&gt;
			exec sp_rename &amp;#039;StandObject.MeanDiameterDeciduous&amp;#039;, &amp;#039;MeanDiameter_Deciduous&amp;#039;, &amp;#039;COLUMN&amp;#039;;&lt;br /&gt;
			exec sp_rename &amp;#039;StandObject.MeanDiameterContorta&amp;#039;, &amp;#039;MeanDiameter_Contorta&amp;#039;, &amp;#039;COLUMN&amp;#039;;&lt;br /&gt;
			exec sp_rename &amp;#039;StandObject.MeanDiameterBroadleaf&amp;#039;, &amp;#039;MeanDiameter_Broadleaf&amp;#039;, &amp;#039;COLUMN&amp;#039;;&lt;br /&gt;
&lt;br /&gt;
			exec sp_rename &amp;#039;StandObject.MeanHeightPine&amp;#039;, &amp;#039;MeanHeight_Pine&amp;#039;, &amp;#039;COLUMN&amp;#039;;&lt;br /&gt;
			exec sp_rename &amp;#039;StandObject.MeanHeightSpruce&amp;#039;, &amp;#039;MeanHeight_Spruce&amp;#039;, &amp;#039;COLUMN&amp;#039;;&lt;br /&gt;
			exec sp_rename &amp;#039;StandObject.MeanHeightBirch&amp;#039;, &amp;#039;MeanHeight_Birch&amp;#039;, &amp;#039;COLUMN&amp;#039;;&lt;br /&gt;
			exec sp_rename &amp;#039;StandObject.MeanHeightAspen&amp;#039;, &amp;#039;MeanHeight_Aspen&amp;#039;, &amp;#039;COLUMN&amp;#039;;&lt;br /&gt;
			exec sp_rename &amp;#039;StandObject.MeanHeightOak&amp;#039;, &amp;#039;MeanHeight_Oak&amp;#039;, &amp;#039;COLUMN&amp;#039;;&lt;br /&gt;
			exec sp_rename &amp;#039;StandObject.MeanHeightBeech&amp;#039;, &amp;#039;MeanHeight_Beech&amp;#039;, &amp;#039;COLUMN&amp;#039;;&lt;br /&gt;
			exec sp_rename &amp;#039;StandObject.MeanHeightDeciduous&amp;#039;, &amp;#039;MeanHeight_Deciduous&amp;#039;, &amp;#039;COLUMN&amp;#039;;&lt;br /&gt;
			exec sp_rename &amp;#039;StandObject.MeanHeightContorta&amp;#039;, &amp;#039;MeanHeight_Contorta&amp;#039;, &amp;#039;COLUMN&amp;#039;;&lt;br /&gt;
			exec sp_rename &amp;#039;StandObject.MeanHeightBroadleaf&amp;#039;, &amp;#039;MeanHeight_Broadleaf&amp;#039;, &amp;#039;COLUMN&amp;#039;;&lt;br /&gt;
&lt;br /&gt;
			exec sp_rename &amp;#039;StandObject.MeanDiameter&amp;#039;, &amp;#039;MeanDiameterTotal&amp;#039;, &amp;#039;COLUMN&amp;#039;;&lt;br /&gt;
			exec sp_rename &amp;#039;StandObject.MeanHeight&amp;#039;, &amp;#039;MeanHeightTotal&amp;#039;, &amp;#039;COLUMN&amp;#039;;&lt;br /&gt;
			exec sp_rename &amp;#039;StandObject.QuadraticMeanDiameter&amp;#039;, &amp;#039;QuadraticMeanDiameterTotal&amp;#039;, &amp;#039;COLUMN&amp;#039;;&lt;br /&gt;
			exec sp_rename &amp;#039;StandObject.LastClearCutYear&amp;#039;, &amp;#039;LastFinalFellingYear&amp;#039;, &amp;#039;COLUMN&amp;#039;;&lt;br /&gt;
		END&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		-- 2. Add columns for arithmetic mean height to table InitialState_SpeciesData&lt;br /&gt;
&lt;br /&gt;
		IF NOT EXISTS (SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = &amp;#039;InitialState_SpeciesData&amp;#039; AND COLUMN_NAME = &amp;#039;ArithmeticMeanHeightPlantPlots_Unknown&amp;#039;)&lt;br /&gt;
		BEGIN&lt;br /&gt;
			ALTER TABLE [InitialState_SpeciesData] ADD&lt;br /&gt;
				[ArithmeticMeanHeightPlantPlots_Unknown] [float] NULL,&lt;br /&gt;
				[ArithmeticMeanHeightPlantPlots_Pine] [float] NULL,&lt;br /&gt;
				[ArithmeticMeanHeightPlantPlots_Spruce] [float] NULL,&lt;br /&gt;
				[ArithmeticMeanHeightPlantPlots_Birch] [float] NULL,&lt;br /&gt;
				[ArithmeticMeanHeightPlantPlots_Aspen] [float] NULL,&lt;br /&gt;
				[ArithmeticMeanHeightPlantPlots_Oak] [float] NULL,&lt;br /&gt;
				[ArithmeticMeanHeightPlantPlots_Beech] [float] NULL,&lt;br /&gt;
				[ArithmeticMeanHeightPlantPlots_Deciduous] [float] NULL,&lt;br /&gt;
				[ArithmeticMeanHeightPlantPlots_Contorta] [float] NULL,&lt;br /&gt;
				[ArithmeticMeanHeightPlantPlots_Broadleaf] [float] NULL&lt;br /&gt;
		END&lt;br /&gt;
&lt;br /&gt;
		-- 3. Add table Cliques&lt;br /&gt;
		IF NOT EXISTS (SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = &amp;#039;Cliques&amp;#039;)&lt;br /&gt;
		BEGIN&lt;br /&gt;
			CREATE TABLE [dbo].[Cliques](&lt;br /&gt;
				[AreaGUID] [uniqueidentifier] NOT NULL,&lt;br /&gt;
				[CliqueID] [int] NOT NULL,&lt;br /&gt;
				[TreatmentUnitGUID] [uniqueidentifier] NOT NULL&lt;br /&gt;
			 ) ON [PRIMARY]&lt;br /&gt;
			ALTER TABLE [dbo].[Cliques]  WITH CHECK ADD  CONSTRAINT [FK_Cliques_TreatmentUnit] FOREIGN KEY([TreatmentUnitGUID])&lt;br /&gt;
			REFERENCES [dbo].[TreatmentUnit] ([TreatmentUnitGUID])&lt;br /&gt;
			ALTER TABLE [dbo].[Cliques] CHECK CONSTRAINT [FK_Cliques_TreatmentUnit]&lt;br /&gt;
			ALTER TABLE [dbo].[Cliques]  WITH CHECK ADD  CONSTRAINT [FK_Cliques_Area] FOREIGN KEY([AreaGUID])&lt;br /&gt;
			REFERENCES [dbo].[Area] ([AreaGUID])&lt;br /&gt;
			ALTER TABLE [dbo].[Cliques] CHECK CONSTRAINT [FK_Cliques_Area]&lt;br /&gt;
		END&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		-- 4. Add table HarvestClusters&lt;br /&gt;
		IF NOT EXISTS (SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = &amp;#039;HarvestClusters&amp;#039;)&lt;br /&gt;
		BEGIN&lt;br /&gt;
			CREATE TABLE [dbo].[HarvestClusters](&lt;br /&gt;
				[AreaGUID] [uniqueidentifier] NOT NULL,&lt;br /&gt;
				[HarvestClusterID] [int] NOT NULL,&lt;br /&gt;
				[TreatmentUnitGUID] [uniqueidentifier] NOT NULL&lt;br /&gt;
			 ) ON [PRIMARY]&lt;br /&gt;
			ALTER TABLE [dbo].[HarvestClusters]  WITH CHECK ADD  CONSTRAINT [FK_HarvestClusters_TreatmentUnit] FOREIGN KEY([TreatmentUnitGUID])&lt;br /&gt;
			REFERENCES [dbo].[TreatmentUnit] ([TreatmentUnitGUID])&lt;br /&gt;
			ALTER TABLE [dbo].[HarvestClusters] CHECK CONSTRAINT [FK_HarvestClusters_TreatmentUnit]&lt;br /&gt;
			ALTER TABLE [dbo].[HarvestClusters]  WITH CHECK ADD  CONSTRAINT [FK_HarvestClusters_Area] FOREIGN KEY([AreaGUID])&lt;br /&gt;
			REFERENCES [dbo].[Area] ([AreaGUID])&lt;br /&gt;
			ALTER TABLE [dbo].[HarvestClusters] CHECK CONSTRAINT [FK_HarvestClusters_Area]&lt;br /&gt;
		END&lt;br /&gt;
&lt;br /&gt;
	-- Update Version Table&lt;br /&gt;
&lt;br /&gt;
	UPDATE Version SET ApplicationVersion = &amp;#039;0.5.3&amp;#039;;&lt;br /&gt;
&lt;br /&gt;
	PRINT &amp;#039;Success! Database upgrade to version 0.5.3&amp;#039;;&lt;br /&gt;
&lt;br /&gt;
END&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Database]]&lt;/div&gt;</summary>
		<author><name>Cawa2</name></author>
	</entry>
</feed>