1
Vote

Database does not contain Tags table

description

The trunk\Databases\VersionedCopy\Fisharoo.mdf file, even at version 22875, does not contain a dbo.Tags table. Consequently the program crashes on startup in TagRepository.GetTagsGlobal with an exception "Invalid object name dbl.Tags".

comments

avinatbmntech wrote Jun 29, 2009 at 12:57 PM

My solution which allowed to project to compile was to use the DBCreateScript to build the versioned
databases:
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
New File ${database.dir}/CreateVersionedCopy.sql
/** Avi Start /
USE master;
GO
IF DB_ID (N'Fisharoo') IS NOT NULL
DROP DATABASE Fisharoo;
GO

DECLARE @data_path nvarchar(256);
SET @data_path = 'C:\Projects\Fisharoo\trunk\Databases\VersionedCopy\'

EXECUTE ('CREATE DATABASE Fisharoo
ON
( NAME = Fisharoo_dat,
FILENAME = '''+ @data_path + 'Fisharoo.mdf'',
SIZE = 10,
MAXSIZE = 50,
FILEGROWTH = 5 )
LOG ON
( NAME = Fisharoo_log,
FILENAME = '''+ @data_path + 'Fisharoo_log.ldf'',
SIZE = 5MB,
MAXSIZE = 25MB,
FILEGROWTH = 5MB )'
);
GO
/** Avi End /
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
In Fisharoo.build
<!--Avi Start--> <target name="buildDatabaseVersionedFromScript" depends="dropDatabaseJustInCase,
      deleteVersionedDatabaseFiles, createVersionedDatabase">
<echo message="#### FINISHED ALL DEPENDS OF TARGET - buildDatabaseLocal ####"/>
</target>
<!--Avi End-->
<!--Avi Start-->
<target name="deleteVersionedDatabaseFiles">
<echo message="#### TARGET - deleteVersionedDatabaseFiles ####"/>
<echo message="Deleting your versioned database files"/>
<delete verbose="true">
  <fileset basedir="${versioneddatabase.dir}">
    <include name="*.mdf"/>
    <include name="*.ldf"/>
  </fileset>
</delete>
</target>

<target name="createVersionedDatabase" >
<echo message="#### TARGET - createVersionedDatabase ####" />
<echo message="     Creating the versioned copy database "/>
<exec failonerror="true" verbose="true" program="osql" 
      commandline="-b -n -S ${database.server.development} -E -i&quot;${database.dir}\CreateVersionedCopy.sql&quot;" />
<echo message="     Building the contents of the versioned copy database "/>
<exec failonerror="true" verbose="true" program="osql"
      commandline="-b -n -S ${database.server.development} -E -i&quot;${database.dir}\DBCreateScript.sql&quot;" />
</target>
<!--Avi End--> <!--Avi Start--> <target name="dropDatabaseJustInCase">
<echo message="#### TARGET - dropDatabaseJustInCase ####"/>
<echo message="Dropping database ${database.name} of server $(database.server.development)"/>
<exec failonerror="false" verbose="true" program="osql" commandline="-b -n -S ${database.server.development} -E -i&quot;${database.dir}\KillProcessesUsingFisharoo.sql&quot; -d master" />
<exec failonerror="false" verbose="true" program="osql" commandline="-b -n -S ${database.server.development} -E -i&quot;${database.dir}\DropFisharoo.sql&quot; -d master" />
</target>
<!--Avi End--> //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

wrote Feb 14, 2013 at 1:59 AM