mirror of
https://github.com/farcasclaudiu/myfriendsaround.git
synced 2026-06-29 13:02:05 +03:00
init commit
This commit is contained in:
Binary file not shown.
@@ -0,0 +1,160 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Name>MyFriendsAround.DB</Name>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectVersion>4.0</ProjectVersion>
|
||||
<ProjectGuid>{67cbc824-a49e-4e9b-a947-360f3dfe65c3}</ProjectGuid>
|
||||
<DSP>Microsoft.Data.Schema.Sql.Sql100DatabaseSchemaProvider</DSP>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<ShowWizard>False</ShowWizard>
|
||||
<OutputType>Database</OutputType>
|
||||
<RootPath>
|
||||
</RootPath>
|
||||
<IncludeSchemaNameInFileName>False</IncludeSchemaNameInFileName>
|
||||
<ModelCollation>1033, CI</ModelCollation>
|
||||
<DefaultFileStructure>BySchema</DefaultFileStructure>
|
||||
<DeployToDatabaseAddToServerExplorer>True</DeployToDatabaseAddToServerExplorer>
|
||||
<DeployToScript>True</DeployToScript>
|
||||
<CatalogPropertiesFile>Properties\Database.sqlsettings</CatalogPropertiesFile>
|
||||
<LoadSqlClrTypes>True</LoadSqlClrTypes>
|
||||
<RootNamespace>MyFriendsAround.DB</RootNamespace>
|
||||
<DefaultSchema>dbo</DefaultSchema>
|
||||
<PreviousProjectVersion>4.0</PreviousProjectVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
|
||||
<OutputPath>.\sql\release\</OutputPath>
|
||||
<BuildScriptName>$(MSBuildProjectName).sql</BuildScriptName>
|
||||
<TargetConnectionString>
|
||||
</TargetConnectionString>
|
||||
<TargetDatabase>
|
||||
</TargetDatabase>
|
||||
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
|
||||
<SuppressWarnings>
|
||||
</SuppressWarnings>
|
||||
<DeploymentConfigFile>Properties\Database.sqldeployment</DeploymentConfigFile>
|
||||
<SqlCommandVariablesFile>Properties\Database.sqlcmdvars</SqlCommandVariablesFile>
|
||||
<DeployToDatabase>False</DeployToDatabase>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||
<OutputPath>.\sql\debug\</OutputPath>
|
||||
<BuildScriptName>$(MSBuildProjectName).sql</BuildScriptName>
|
||||
<TargetConnectionString>
|
||||
</TargetConnectionString>
|
||||
<TargetDatabase>
|
||||
</TargetDatabase>
|
||||
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
|
||||
<SuppressWarnings>
|
||||
</SuppressWarnings>
|
||||
<DeploymentConfigFile>Properties\Database.sqldeployment</DeploymentConfigFile>
|
||||
<SqlCommandVariablesFile>Properties\Database.sqlcmdvars</SqlCommandVariablesFile>
|
||||
<DeployToDatabase>False</DeployToDatabase>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Tests' ">
|
||||
<BuildScriptName>$(MSBuildProjectName).sql</BuildScriptName>
|
||||
<TargetConnectionString />
|
||||
<TargetDatabase />
|
||||
<TreatWarningsAsErrors>False</TreatWarningsAsErrors>
|
||||
<SuppressWarnings />
|
||||
<DeploymentConfigFile>Properties\Database.sqldeployment</DeploymentConfigFile>
|
||||
<SqlCommandVariablesFile>Properties\Database.sqlcmdvars</SqlCommandVariablesFile>
|
||||
<DeployToDatabase>False</DeployToDatabase>
|
||||
<OutputPath>.\sql\Tests\</OutputPath>
|
||||
</PropertyGroup>
|
||||
<!--Import the settings-->
|
||||
<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v10.0\TeamData\Microsoft.Data.Schema.SqlTasks.targets" />
|
||||
<ItemGroup>
|
||||
<Folder Include="Scripts" />
|
||||
<Folder Include="Scripts\Pre-Deployment" />
|
||||
<Folder Include="Scripts\Post-Deployment" />
|
||||
<Folder Include="Data Generation Plans" />
|
||||
<Folder Include="Schema Comparisons" />
|
||||
<Folder Include="Properties\" />
|
||||
<Folder Include="Schema Objects\" />
|
||||
<Folder Include="Schema Objects\Schemas\" />
|
||||
<Folder Include="Schema Objects\Schemas\dbo\" />
|
||||
<Folder Include="Schema Objects\Schemas\dbo\Programmability\" />
|
||||
<Folder Include="Schema Objects\Schemas\dbo\Programmability\Defaults\" />
|
||||
<Folder Include="Schema Objects\Schemas\dbo\Programmability\Functions\" />
|
||||
<Folder Include="Schema Objects\Schemas\dbo\Programmability\Rules\" />
|
||||
<Folder Include="Schema Objects\Schemas\dbo\Programmability\Stored Procedures\" />
|
||||
<Folder Include="Schema Objects\Schemas\dbo\Programmability\Types\" />
|
||||
<Folder Include="Schema Objects\Schemas\dbo\Programmability\Types\User Defined Data Types\" />
|
||||
<Folder Include="Schema Objects\Schemas\dbo\Programmability\Types\User Defined Types CLR\" />
|
||||
<Folder Include="Schema Objects\Schemas\dbo\Programmability\Types\User Defined Table Types\" />
|
||||
<Folder Include="Schema Objects\Schemas\dbo\Programmability\Types\XML Schema Collections\" />
|
||||
<Folder Include="Schema Objects\Schemas\dbo\Service Broker\" />
|
||||
<Folder Include="Schema Objects\Schemas\dbo\Service Broker\Queues\" />
|
||||
<Folder Include="Schema Objects\Schemas\dbo\Synonyms\" />
|
||||
<Folder Include="Schema Objects\Schemas\dbo\Tables\" />
|
||||
<Folder Include="Schema Objects\Schemas\dbo\Tables\Constraints\" />
|
||||
<Folder Include="Schema Objects\Schemas\dbo\Tables\Indexes\" />
|
||||
<Folder Include="Schema Objects\Schemas\dbo\Tables\Keys\" />
|
||||
<Folder Include="Schema Objects\Schemas\dbo\Tables\Triggers\" />
|
||||
<Folder Include="Schema Objects\Schemas\dbo\Tables\Statistics\" />
|
||||
<Folder Include="Schema Objects\Schemas\dbo\Views\" />
|
||||
<Folder Include="Schema Objects\Schemas\dbo\Views\Indexes\" />
|
||||
<Folder Include="Schema Objects\Schemas\dbo\Views\Triggers\" />
|
||||
<Folder Include="Schema Objects\Schemas\dbo\Views\Statistics\" />
|
||||
<Folder Include="Schema Objects\Database Level Objects\" />
|
||||
<Folder Include="Schema Objects\Database Level Objects\Assemblies\" />
|
||||
<Folder Include="Schema Objects\Database Level Objects\Database Triggers\" />
|
||||
<Folder Include="Schema Objects\Database Level Objects\Security\" />
|
||||
<Folder Include="Schema Objects\Database Level Objects\Security\Schemas\" />
|
||||
<Folder Include="Schema Objects\Database Level Objects\Security\Users\" />
|
||||
<Folder Include="Schema Objects\Database Level Objects\Security\Certificates\" />
|
||||
<Folder Include="Schema Objects\Database Level Objects\Security\Asymmetric Keys\" />
|
||||
<Folder Include="Schema Objects\Database Level Objects\Security\Master Keys\" />
|
||||
<Folder Include="Schema Objects\Database Level Objects\Security\Signatures\" />
|
||||
<Folder Include="Schema Objects\Database Level Objects\Security\Symmetric Keys\" />
|
||||
<Folder Include="Schema Objects\Database Level Objects\Security\Database Encryption Keys\" />
|
||||
<Folder Include="Schema Objects\Database Level Objects\Security\Database Audit Specification\" />
|
||||
<Folder Include="Schema Objects\Database Level Objects\Security\Roles\" />
|
||||
<Folder Include="Schema Objects\Database Level Objects\Security\Roles\Application Roles\" />
|
||||
<Folder Include="Schema Objects\Database Level Objects\Security\Roles\Database Roles\" />
|
||||
<Folder Include="Schema Objects\Database Level Objects\Service Broker\" />
|
||||
<Folder Include="Schema Objects\Database Level Objects\Service Broker\Broker Priorities\" />
|
||||
<Folder Include="Schema Objects\Database Level Objects\Service Broker\Contracts\" />
|
||||
<Folder Include="Schema Objects\Database Level Objects\Service Broker\Event Notifications\" />
|
||||
<Folder Include="Schema Objects\Database Level Objects\Service Broker\Message Types\" />
|
||||
<Folder Include="Schema Objects\Database Level Objects\Service Broker\Remote Service Binding\" />
|
||||
<Folder Include="Schema Objects\Database Level Objects\Service Broker\Routes\" />
|
||||
<Folder Include="Schema Objects\Database Level Objects\Service Broker\Services\" />
|
||||
<Folder Include="Schema Objects\Database Level Objects\Storage\" />
|
||||
<Folder Include="Schema Objects\Database Level Objects\Storage\Full Text Stoplists\" />
|
||||
<Folder Include="Schema Objects\Database Level Objects\Storage\Filegroups\" />
|
||||
<Folder Include="Schema Objects\Database Level Objects\Storage\Files\" />
|
||||
<Folder Include="Schema Objects\Database Level Objects\Storage\Full Text Catalogs\" />
|
||||
<Folder Include="Schema Objects\Database Level Objects\Storage\Partition Functions\" />
|
||||
<Folder Include="Schema Objects\Database Level Objects\Storage\Partition Schemes\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PropertiesFile Include="Properties\Database.sqlsettings">
|
||||
</PropertiesFile>
|
||||
<PropertiesFile Include="Properties\Database.sqldeployment">
|
||||
</PropertiesFile>
|
||||
<PropertiesFile Include="Properties\Database.sqlcmdvars">
|
||||
</PropertiesFile>
|
||||
<Build Include="Properties\Database.sqlpermissions">
|
||||
<ModelBuilderType>Permissions</ModelBuilderType>
|
||||
</Build>
|
||||
<PreDeploy Include="Scripts\Pre-Deployment\Script.PreDeployment.sql">
|
||||
<SubType>Code</SubType>
|
||||
</PreDeploy>
|
||||
<PostDeploy Include="Scripts\Post-Deployment\Script.PostDeployment.sql">
|
||||
<SubType>Code</SubType>
|
||||
</PostDeploy>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<BuildContributorArgument Include="OutDir=$(OutDir)" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<NotInBuild Include="Schema Objects\Schemas\dbo\Tables\Friends.sql">
|
||||
<SubType>NotInBuild</SubType>
|
||||
</NotInBuild>
|
||||
<NotInBuild Include="Schema Objects\Schemas\dbo\Programmability\Stored Procedures\sp_UpdateFriendLocationById.sql">
|
||||
<SubType>NotInBuild</SubType>
|
||||
</NotInBuild>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<SchemaViewView>1</SchemaViewView>
|
||||
<SchemaViewShowExternalElements>0</SchemaViewShowExternalElements>
|
||||
<SchemaViewShowBuiltInElements>0</SchemaViewShowBuiltInElements>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<SqlCommandVariables xmlns="urn:Microsoft.VisualStudio.Data.Schema.Package.SqlCmdVars" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<Version>1.0</Version>
|
||||
<Properties>
|
||||
</Properties>
|
||||
</SqlCommandVariables>
|
||||
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<DeploymentConfigurationSettings xmlns="urn:Microsoft.VisualStudio.Data.Schema.Package.DeploymentConfigurationSettings" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<Version>1.0</Version>
|
||||
<Properties>
|
||||
<AlwaysCreateNewDatabase>False</AlwaysCreateNewDatabase>
|
||||
<BlockIncrementalDeploymentIfDataLoss>True</BlockIncrementalDeploymentIfDataLoss>
|
||||
<DeployDatabaseProperties>True</DeployDatabaseProperties>
|
||||
<DeploymentCollationPreference>UseSourceModelCollation</DeploymentCollationPreference>
|
||||
<DoNotUseAlterAssemblyStatementsToUpdateCLRTypes>False</DoNotUseAlterAssemblyStatementsToUpdateCLRTypes>
|
||||
<GenerateDropsIfNotInProject>False</GenerateDropsIfNotInProject>
|
||||
<PerformDatabaseBackup>False</PerformDatabaseBackup>
|
||||
<SingleUserMode>False</SingleUserMode>
|
||||
</Properties>
|
||||
</DeploymentConfigurationSettings>
|
||||
@@ -0,0 +1,44 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Permissions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:Microsoft.VisualStudio.Data.Schema.Permissions" Version="1.0">
|
||||
<!-- The examples below are provided to illustrate how permissions
|
||||
are defined in the project system for Databases, Objects,
|
||||
and Columns.
|
||||
|
||||
GRANT Database Permissions
|
||||
|
||||
<PermissionStatement Action ="GRANT">
|
||||
<Permission>CREATE TABLE</Permission>
|
||||
<Grantee>User1</Grantee>
|
||||
</PermissionStatement>
|
||||
|
||||
GRANT Object Permission
|
||||
|
||||
<PermissionStatement Action ="GRANT">
|
||||
<Permission>SELECT</Permission>
|
||||
<Grantee>User1</Grantee>
|
||||
<Object Name ="Table1" Schema ="User1" Type ="OBJECT"/>
|
||||
</PermissionStatement>
|
||||
|
||||
DENY Object Permission
|
||||
|
||||
<PermissionStatement Action ="DENY">
|
||||
<Permission>DELETE</Permission>
|
||||
<Grantee>User1</Grantee>
|
||||
<Object Name ="Table1" Schema ="User1" Type ="OBJECT"/>
|
||||
</PermissionStatement>
|
||||
|
||||
GRANT Object Column Permission
|
||||
|
||||
<PermissionStatement Action ="GRANT">
|
||||
<Permission>SELECT</Permission>
|
||||
<Grantee>User1</Grantee>
|
||||
<Object Name ="Table1" Schema ="User1" Type ="OBJECT">
|
||||
<Columns Treatment ="INCLUDE">
|
||||
<Column Name="Col1"/>
|
||||
<Column Name="Col2"/>
|
||||
<Column Name="…"/>
|
||||
</Columns>
|
||||
</Object>
|
||||
</PermissionStatement>
|
||||
-->
|
||||
</Permissions>
|
||||
@@ -0,0 +1,52 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<CatalogProperties xmlns="urn:Microsoft.VisualStudio.Data.Schema.Package.CatalogProperties" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<Version>1.0</Version>
|
||||
<Properties>
|
||||
<!--Sql Server 2000-->
|
||||
<DefaultCollation>SQL_Latin1_General_CP1_CI_AS</DefaultCollation>
|
||||
<AnsiNullDefault>True</AnsiNullDefault>
|
||||
<AnsiNulls>True</AnsiNulls>
|
||||
<AnsiPadding>True</AnsiPadding>
|
||||
<AnsiWarnings>True</AnsiWarnings>
|
||||
<ArithAbort>True</ArithAbort>
|
||||
<ConcatNullYieldsNull>True</ConcatNullYieldsNull>
|
||||
<QuotedIdentifier>True</QuotedIdentifier>
|
||||
<NumericRoundAbort>False</NumericRoundAbort>
|
||||
<RecursiveTriggersEnabled>False</RecursiveTriggersEnabled>
|
||||
<DatabaseState>ONLINE</DatabaseState>
|
||||
<UpdateOptions>READ_WRITE</UpdateOptions>
|
||||
<CloseCursorOnCommitEnabled>False</CloseCursorOnCommitEnabled>
|
||||
<DefaultCursor>LOCAL</DefaultCursor>
|
||||
<AutoClose>False</AutoClose>
|
||||
<AutoCreateStatistics>True</AutoCreateStatistics>
|
||||
<AutoShrink>False</AutoShrink>
|
||||
<AutoUpdateStatistics>True</AutoUpdateStatistics>
|
||||
<TornPageDetection>False</TornPageDetection>
|
||||
<DatabaseAccess>MULTI_USER</DatabaseAccess>
|
||||
<Recovery>FULL</Recovery>
|
||||
<EnableFullTextSearch>True</EnableFullTextSearch>
|
||||
<DatabaseChaining>False</DatabaseChaining>
|
||||
<DefaultFilegroup>PRIMARY</DefaultFilegroup>
|
||||
<!--Sql Server 2005-->
|
||||
<!--<CompatibilityMode></CompatibilityMode>-->
|
||||
<Trustworthy>False</Trustworthy>
|
||||
<AutoUpdateStatisticsAsynchronously>False</AutoUpdateStatisticsAsynchronously>
|
||||
<PageVerify>NONE</PageVerify>
|
||||
<ServiceBrokerOption>DisableBroker</ServiceBrokerOption>
|
||||
<DateCorrelationOptimizationOn>False</DateCorrelationOptimizationOn>
|
||||
<Parameterization>SIMPLE</Parameterization>
|
||||
<AllowSnapshotIsolation>False</AllowSnapshotIsolation>
|
||||
<ReadCommittedSnapshot>False</ReadCommittedSnapshot>
|
||||
<VardecimalStorageFormatOn>True</VardecimalStorageFormatOn>
|
||||
<SupplementalLoggingOn>False</SupplementalLoggingOn>
|
||||
<!--Sql Server 2008-->
|
||||
<DefaultFileStreamFilegroup></DefaultFileStreamFilegroup>
|
||||
<IsChangeTrackingOn>False</IsChangeTrackingOn>
|
||||
<IsChangeTrackingAutoCleanupOn>True</IsChangeTrackingAutoCleanupOn>
|
||||
<ChangeTrackingRetentionPeriod>2</ChangeTrackingRetentionPeriod>
|
||||
<ChangeTrackingRetentionUnit>Days</ChangeTrackingRetentionUnit>
|
||||
<IsEncryptionOn>False</IsEncryptionOn>
|
||||
<IsBrokerPriorityHonored>False</IsBrokerPriorityHonored>
|
||||
</Properties>
|
||||
</CatalogProperties>
|
||||
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
-- =============================================
|
||||
CREATE PROCEDURE UpdateFriendLocationById
|
||||
@FriendID nvarchar
|
||||
AS
|
||||
BEGIN
|
||||
-- SET NOCOUNT ON added to prevent extra result sets from
|
||||
-- interfering with SELECT statements.
|
||||
SET NOCOUNT ON;
|
||||
|
||||
-- Insert statements for procedure here
|
||||
UPDATE [Friends]
|
||||
SET [Location] = GEOGRAPHY::Parse([LocationStr])
|
||||
WHERE Id = @FriendID
|
||||
END
|
||||
GO
|
||||
@@ -0,0 +1,24 @@
|
||||
-- =============================================
|
||||
-- Script Template
|
||||
-- =============================================
|
||||
USE [MyFriends]
|
||||
GO
|
||||
/****** Object: Table [dbo].[Friends] Script Date: 03/14/2011 18:32:33 ******/
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
SET QUOTED_IDENTIFIER ON
|
||||
GO
|
||||
CREATE TABLE [dbo].[Friends](
|
||||
[Id] [nvarchar](100) NOT NULL,
|
||||
[FriendName] [nvarchar](50) NOT NULL,
|
||||
[FriendImageUrl] [nvarchar](150) NULL,
|
||||
[LocationStr] [nvarchar](100) NULL,
|
||||
[Location] [geography] NULL,
|
||||
[LastUpdated] [datetime] NOT NULL,
|
||||
CONSTRAINT [PK_Friends] PRIMARY KEY CLUSTERED
|
||||
(
|
||||
[Id] ASC
|
||||
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
|
||||
) ON [PRIMARY]
|
||||
GO
|
||||
INSERT [dbo].[Friends] ([Id], [FriendName], [FriendImageUrl], [LocationStr], [Location], [LastUpdated]) VALUES (N'1', N'Clody', N'http://aaa.com/aaa.png', N'POINT(10 34)', NULL, CAST(0x00009EA600000000 AS DateTime))
|
||||
@@ -0,0 +1,11 @@
|
||||
/*
|
||||
Post-Deployment Script Template
|
||||
--------------------------------------------------------------------------------------
|
||||
This file contains SQL statements that will be appended to the build script.
|
||||
Use SQLCMD syntax to include a file in the post-deployment script.
|
||||
Example: :r .\myfile.sql
|
||||
Use SQLCMD syntax to reference a variable in the post-deployment script.
|
||||
Example: :setvar TableName MyTable
|
||||
SELECT * FROM [$(TableName)]
|
||||
--------------------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -0,0 +1,11 @@
|
||||
/*
|
||||
Pre-Deployment Script Template
|
||||
--------------------------------------------------------------------------------------
|
||||
This file contains SQL statements that will be executed before the build script.
|
||||
Use SQLCMD syntax to include a file in the pre-deployment script.
|
||||
Example: :r .\myfile.sql
|
||||
Use SQLCMD syntax to reference a variable in the pre-deployment script.
|
||||
Example: :setvar TableName MyTable
|
||||
SELECT * FROM [$(TableName)]
|
||||
--------------------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<DataSchemaModel FileFormatVersion="1.2" SchemaVersion="1.1" DspName="Microsoft.Data.Schema.Sql.Sql100DatabaseSchemaProvider" CollationLcid="1033" CollationCaseSensitive="False">
|
||||
<Header>
|
||||
<CustomData Category="ModelCapability">
|
||||
<Metadata Name="ModelCapability" Value="Default" />
|
||||
</CustomData>
|
||||
<CustomData Category="ClrTypesDbSchema" Type="DbSchema">
|
||||
<Metadata Name="ClrTypesDbSchema" Value="True" />
|
||||
</CustomData>
|
||||
<CustomData Category="AnsiNulls">
|
||||
<Metadata Name="AnsiNulls" Value="True" />
|
||||
</CustomData>
|
||||
<CustomData Category="QuotedIdentifier">
|
||||
<Metadata Name="QuotedIdentifier" Value="True" />
|
||||
</CustomData>
|
||||
<CustomData Category="CompatibilityMode">
|
||||
<Metadata Name="CompatibilityMode" Value="100" />
|
||||
</CustomData>
|
||||
<CustomData Category="Permissions" Type="XmlPermissions">
|
||||
<Metadata Name="FileName" Value="C:\PROJECTS\MYFRIENDSAROUND\MYFRIENDSAROUND.DB\PROPERTIES\DATABASE.SQLPERMISSIONS" />
|
||||
</CustomData>
|
||||
</Header>
|
||||
<Model>
|
||||
<Element Type="ISql100DatabaseOptions">
|
||||
<Property Name="Collation" Value="SQL_Latin1_General_CP1_CI_AS" />
|
||||
<Property Name="IsAnsiNullDefaultOn" Value="True" />
|
||||
<Property Name="IsAnsiNullsOn" Value="True" />
|
||||
<Property Name="IsAnsiWarningsOn" Value="True" />
|
||||
<Property Name="IsArithAbortOn" Value="True" />
|
||||
<Property Name="IsConcatNullYieldsNullOn" Value="True" />
|
||||
<Property Name="IsTornPageProtectionOn" Value="False" />
|
||||
<Property Name="IsFullTextEnabled" Value="True" />
|
||||
<Property Name="PageVerifyMode" Value="3" />
|
||||
<Relationship Name="DefaultFilegroup">
|
||||
<Entry>
|
||||
<References ExternalSource="BuiltIns" Name="[PRIMARY]" />
|
||||
</Entry>
|
||||
</Relationship>
|
||||
</Element>
|
||||
</Model>
|
||||
</DataSchemaModel>
|
||||
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<TargetDatabase>MyFriendsAround.DB</TargetDatabase>
|
||||
<DeployToDatabase>False</DeployToDatabase>
|
||||
<DeployToScript>True</DeployToScript>
|
||||
<SourceModel>MyFriendsAround.DB.dbschema</SourceModel>
|
||||
<DeployScriptFileName>MyFriendsAround.DB.sql</DeployScriptFileName>
|
||||
<DeploymentConfigurationFile>MyFriendsAround.DB_Database.sqldeployment</DeploymentConfigurationFile>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<SqlCommandVariablesFile>MyFriendsAround.DB_Database.sqlcmdvars</SqlCommandVariablesFile>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<DeploymentExtensionConfiguration Include="MyFriendsAround.DB_Script.PostDeployment.sql">
|
||||
<__PostdeploymentMetadata>
|
||||
</__PostdeploymentMetadata>
|
||||
</DeploymentExtensionConfiguration>
|
||||
<DeploymentExtensionConfiguration Include="MyFriendsAround.DB_Script.PreDeployment.sql">
|
||||
<__PredeploymentMetadata>
|
||||
</__PredeploymentMetadata>
|
||||
</DeploymentExtensionConfiguration>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<DeploymentExtension Include="Microsoft.Data.Schema.Sql.Build.SqlPlanOrderModifier">
|
||||
<Assembly>Microsoft.Data.Schema.Sql</Assembly>
|
||||
<Version>10.0.0.0</Version>
|
||||
<Token>sD9ffxHVCjo=</Token>
|
||||
</DeploymentExtension>
|
||||
<DeploymentExtension Include="Microsoft.Data.Schema.Sql.Build.SqlPrePostDeploymentModifier">
|
||||
<Assembly>Microsoft.Data.Schema.Sql</Assembly>
|
||||
<Version>10.0.0.0</Version>
|
||||
<Token>sD9ffxHVCjo=</Token>
|
||||
</DeploymentExtension>
|
||||
<DeploymentExtension Include="Microsoft.Data.Schema.Sql.Refactoring.SqlRefactoringDeploymentContributor">
|
||||
<Assembly>Microsoft.Data.Schema.Sql</Assembly>
|
||||
<Version>10.0.0.0</Version>
|
||||
<Token>sD9ffxHVCjo=</Token>
|
||||
</DeploymentExtension>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,211 @@
|
||||
/*
|
||||
Deployment script for MyFriendsAround.DB
|
||||
*/
|
||||
|
||||
GO
|
||||
SET ANSI_NULLS, ANSI_PADDING, ANSI_WARNINGS, ARITHABORT, CONCAT_NULL_YIELDS_NULL, QUOTED_IDENTIFIER ON;
|
||||
|
||||
SET NUMERIC_ROUNDABORT OFF;
|
||||
|
||||
|
||||
GO
|
||||
:setvar DatabaseName "MyFriendsAround.DB"
|
||||
:setvar DefaultDataPath ""
|
||||
:setvar DefaultLogPath ""
|
||||
|
||||
GO
|
||||
:on error exit
|
||||
GO
|
||||
USE [master]
|
||||
GO
|
||||
IF (DB_ID(N'$(DatabaseName)') IS NOT NULL
|
||||
AND DATABASEPROPERTYEX(N'$(DatabaseName)','Status') <> N'ONLINE')
|
||||
BEGIN
|
||||
RAISERROR(N'The state of the target database, %s, is not set to ONLINE. To deploy to this database, its state must be set to ONLINE.', 16, 127,N'$(DatabaseName)') WITH NOWAIT
|
||||
RETURN
|
||||
END
|
||||
|
||||
GO
|
||||
IF (DB_ID(N'$(DatabaseName)') IS NOT NULL)
|
||||
BEGIN
|
||||
ALTER DATABASE [$(DatabaseName)]
|
||||
SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
|
||||
DROP DATABASE [$(DatabaseName)];
|
||||
END
|
||||
|
||||
GO
|
||||
PRINT N'Creating $(DatabaseName)...'
|
||||
GO
|
||||
CREATE DATABASE [$(DatabaseName)] COLLATE SQL_Latin1_General_CP1_CI_AS
|
||||
GO
|
||||
EXECUTE sp_dbcmptlevel [$(DatabaseName)], 100;
|
||||
|
||||
|
||||
GO
|
||||
IF EXISTS (SELECT 1
|
||||
FROM [master].[dbo].[sysdatabases]
|
||||
WHERE [name] = N'$(DatabaseName)')
|
||||
BEGIN
|
||||
ALTER DATABASE [$(DatabaseName)]
|
||||
SET ANSI_NULLS ON,
|
||||
ANSI_PADDING ON,
|
||||
ANSI_WARNINGS ON,
|
||||
ARITHABORT ON,
|
||||
CONCAT_NULL_YIELDS_NULL ON,
|
||||
NUMERIC_ROUNDABORT OFF,
|
||||
QUOTED_IDENTIFIER ON,
|
||||
ANSI_NULL_DEFAULT ON,
|
||||
CURSOR_DEFAULT LOCAL,
|
||||
RECOVERY FULL,
|
||||
CURSOR_CLOSE_ON_COMMIT OFF,
|
||||
AUTO_CREATE_STATISTICS ON,
|
||||
AUTO_SHRINK OFF,
|
||||
AUTO_UPDATE_STATISTICS ON,
|
||||
RECURSIVE_TRIGGERS OFF
|
||||
WITH ROLLBACK IMMEDIATE;
|
||||
ALTER DATABASE [$(DatabaseName)]
|
||||
SET AUTO_CLOSE OFF
|
||||
WITH ROLLBACK IMMEDIATE;
|
||||
END
|
||||
|
||||
|
||||
GO
|
||||
IF EXISTS (SELECT 1
|
||||
FROM [master].[dbo].[sysdatabases]
|
||||
WHERE [name] = N'$(DatabaseName)')
|
||||
BEGIN
|
||||
ALTER DATABASE [$(DatabaseName)]
|
||||
SET ALLOW_SNAPSHOT_ISOLATION OFF;
|
||||
END
|
||||
|
||||
|
||||
GO
|
||||
IF EXISTS (SELECT 1
|
||||
FROM [master].[dbo].[sysdatabases]
|
||||
WHERE [name] = N'$(DatabaseName)')
|
||||
BEGIN
|
||||
ALTER DATABASE [$(DatabaseName)]
|
||||
SET READ_COMMITTED_SNAPSHOT OFF;
|
||||
END
|
||||
|
||||
|
||||
GO
|
||||
IF EXISTS (SELECT 1
|
||||
FROM [master].[dbo].[sysdatabases]
|
||||
WHERE [name] = N'$(DatabaseName)')
|
||||
BEGIN
|
||||
ALTER DATABASE [$(DatabaseName)]
|
||||
SET AUTO_UPDATE_STATISTICS_ASYNC OFF,
|
||||
PAGE_VERIFY NONE,
|
||||
DATE_CORRELATION_OPTIMIZATION OFF,
|
||||
DISABLE_BROKER,
|
||||
PARAMETERIZATION SIMPLE,
|
||||
SUPPLEMENTAL_LOGGING OFF
|
||||
WITH ROLLBACK IMMEDIATE;
|
||||
END
|
||||
|
||||
|
||||
GO
|
||||
IF IS_SRVROLEMEMBER(N'sysadmin') = 1
|
||||
BEGIN
|
||||
IF EXISTS (SELECT 1
|
||||
FROM [master].[dbo].[sysdatabases]
|
||||
WHERE [name] = N'$(DatabaseName)')
|
||||
BEGIN
|
||||
EXECUTE sp_executesql N'ALTER DATABASE [$(DatabaseName)]
|
||||
SET TRUSTWORTHY OFF,
|
||||
DB_CHAINING OFF
|
||||
WITH ROLLBACK IMMEDIATE';
|
||||
END
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
PRINT N'The database settings cannot be modified. You must be a SysAdmin to apply these settings.';
|
||||
END
|
||||
|
||||
|
||||
GO
|
||||
IF IS_SRVROLEMEMBER(N'sysadmin') = 1
|
||||
BEGIN
|
||||
IF EXISTS (SELECT 1
|
||||
FROM [master].[dbo].[sysdatabases]
|
||||
WHERE [name] = N'$(DatabaseName)')
|
||||
BEGIN
|
||||
EXECUTE sp_executesql N'ALTER DATABASE [$(DatabaseName)]
|
||||
SET HONOR_BROKER_PRIORITY OFF
|
||||
WITH ROLLBACK IMMEDIATE';
|
||||
END
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
PRINT N'The database settings cannot be modified. You must be a SysAdmin to apply these settings.';
|
||||
END
|
||||
|
||||
|
||||
GO
|
||||
USE [$(DatabaseName)]
|
||||
GO
|
||||
IF fulltextserviceproperty(N'IsFulltextInstalled') = 1
|
||||
EXECUTE sp_fulltext_database 'enable';
|
||||
|
||||
|
||||
GO
|
||||
/*
|
||||
Pre-Deployment Script Template
|
||||
--------------------------------------------------------------------------------------
|
||||
This file contains SQL statements that will be executed before the build script.
|
||||
Use SQLCMD syntax to include a file in the pre-deployment script.
|
||||
Example: :r .\myfile.sql
|
||||
Use SQLCMD syntax to reference a variable in the pre-deployment script.
|
||||
Example: :setvar TableName MyTable
|
||||
SELECT * FROM [$(TableName)]
|
||||
--------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
GO
|
||||
-- Refactoring step to update target server with deployed transaction logs
|
||||
CREATE TABLE [dbo].[__RefactorLog] (OperationKey UNIQUEIDENTIFIER NOT NULL PRIMARY KEY)
|
||||
GO
|
||||
sp_addextendedproperty N'microsoft_database_tools_support', N'refactoring log', N'schema', N'dbo', N'table', N'__RefactorLog'
|
||||
GO
|
||||
|
||||
GO
|
||||
/*
|
||||
Post-Deployment Script Template
|
||||
--------------------------------------------------------------------------------------
|
||||
This file contains SQL statements that will be appended to the build script.
|
||||
Use SQLCMD syntax to include a file in the post-deployment script.
|
||||
Example: :r .\myfile.sql
|
||||
Use SQLCMD syntax to reference a variable in the post-deployment script.
|
||||
Example: :setvar TableName MyTable
|
||||
SELECT * FROM [$(TableName)]
|
||||
--------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
GO
|
||||
IF EXISTS (SELECT 1
|
||||
FROM [master].[dbo].[sysdatabases]
|
||||
WHERE [name] = N'$(DatabaseName)')
|
||||
BEGIN
|
||||
DECLARE @VarDecimalSupported AS BIT;
|
||||
SELECT @VarDecimalSupported = 0;
|
||||
IF ((ServerProperty(N'EngineEdition') = 3)
|
||||
AND (((@@microsoftversion / power(2, 24) = 9)
|
||||
AND (@@microsoftversion & 0xffff >= 3024))
|
||||
OR ((@@microsoftversion / power(2, 24) = 10)
|
||||
AND (@@microsoftversion & 0xffff >= 1600))))
|
||||
SELECT @VarDecimalSupported = 1;
|
||||
IF (@VarDecimalSupported > 0)
|
||||
BEGIN
|
||||
EXECUTE sp_db_vardecimal_storage_format N'$(DatabaseName)', 'ON';
|
||||
END
|
||||
END
|
||||
|
||||
|
||||
GO
|
||||
ALTER DATABASE [$(DatabaseName)]
|
||||
SET MULTI_USER
|
||||
WITH ROLLBACK IMMEDIATE;
|
||||
|
||||
|
||||
GO
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<SqlCommandVariables xmlns="urn:Microsoft.VisualStudio.Data.Schema.Package.SqlCmdVars" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<Version>1.0</Version>
|
||||
<Properties>
|
||||
</Properties>
|
||||
</SqlCommandVariables>
|
||||
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<DeploymentConfigurationSettings xmlns="urn:Microsoft.VisualStudio.Data.Schema.Package.DeploymentConfigurationSettings" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<Version>1.0</Version>
|
||||
<Properties>
|
||||
<AlwaysCreateNewDatabase>False</AlwaysCreateNewDatabase>
|
||||
<BlockIncrementalDeploymentIfDataLoss>True</BlockIncrementalDeploymentIfDataLoss>
|
||||
<DeployDatabaseProperties>True</DeployDatabaseProperties>
|
||||
<DeploymentCollationPreference>UseSourceModelCollation</DeploymentCollationPreference>
|
||||
<DoNotUseAlterAssemblyStatementsToUpdateCLRTypes>False</DoNotUseAlterAssemblyStatementsToUpdateCLRTypes>
|
||||
<GenerateDropsIfNotInProject>False</GenerateDropsIfNotInProject>
|
||||
<PerformDatabaseBackup>False</PerformDatabaseBackup>
|
||||
<SingleUserMode>False</SingleUserMode>
|
||||
</Properties>
|
||||
</DeploymentConfigurationSettings>
|
||||
@@ -0,0 +1,52 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<CatalogProperties xmlns="urn:Microsoft.VisualStudio.Data.Schema.Package.CatalogProperties" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<Version>1.0</Version>
|
||||
<Properties>
|
||||
<!--Sql Server 2000-->
|
||||
<DefaultCollation>SQL_Latin1_General_CP1_CI_AS</DefaultCollation>
|
||||
<AnsiNullDefault>True</AnsiNullDefault>
|
||||
<AnsiNulls>True</AnsiNulls>
|
||||
<AnsiPadding>True</AnsiPadding>
|
||||
<AnsiWarnings>True</AnsiWarnings>
|
||||
<ArithAbort>True</ArithAbort>
|
||||
<ConcatNullYieldsNull>True</ConcatNullYieldsNull>
|
||||
<QuotedIdentifier>True</QuotedIdentifier>
|
||||
<NumericRoundAbort>False</NumericRoundAbort>
|
||||
<RecursiveTriggersEnabled>False</RecursiveTriggersEnabled>
|
||||
<DatabaseState>ONLINE</DatabaseState>
|
||||
<UpdateOptions>READ_WRITE</UpdateOptions>
|
||||
<CloseCursorOnCommitEnabled>False</CloseCursorOnCommitEnabled>
|
||||
<DefaultCursor>LOCAL</DefaultCursor>
|
||||
<AutoClose>False</AutoClose>
|
||||
<AutoCreateStatistics>True</AutoCreateStatistics>
|
||||
<AutoShrink>False</AutoShrink>
|
||||
<AutoUpdateStatistics>True</AutoUpdateStatistics>
|
||||
<TornPageDetection>False</TornPageDetection>
|
||||
<DatabaseAccess>MULTI_USER</DatabaseAccess>
|
||||
<Recovery>FULL</Recovery>
|
||||
<EnableFullTextSearch>True</EnableFullTextSearch>
|
||||
<DatabaseChaining>False</DatabaseChaining>
|
||||
<DefaultFilegroup>PRIMARY</DefaultFilegroup>
|
||||
<!--Sql Server 2005-->
|
||||
<!--<CompatibilityMode></CompatibilityMode>-->
|
||||
<Trustworthy>False</Trustworthy>
|
||||
<AutoUpdateStatisticsAsynchronously>False</AutoUpdateStatisticsAsynchronously>
|
||||
<PageVerify>NONE</PageVerify>
|
||||
<ServiceBrokerOption>DisableBroker</ServiceBrokerOption>
|
||||
<DateCorrelationOptimizationOn>False</DateCorrelationOptimizationOn>
|
||||
<Parameterization>SIMPLE</Parameterization>
|
||||
<AllowSnapshotIsolation>False</AllowSnapshotIsolation>
|
||||
<ReadCommittedSnapshot>False</ReadCommittedSnapshot>
|
||||
<VardecimalStorageFormatOn>True</VardecimalStorageFormatOn>
|
||||
<SupplementalLoggingOn>False</SupplementalLoggingOn>
|
||||
<!--Sql Server 2008-->
|
||||
<DefaultFileStreamFilegroup></DefaultFileStreamFilegroup>
|
||||
<IsChangeTrackingOn>False</IsChangeTrackingOn>
|
||||
<IsChangeTrackingAutoCleanupOn>True</IsChangeTrackingAutoCleanupOn>
|
||||
<ChangeTrackingRetentionPeriod>2</ChangeTrackingRetentionPeriod>
|
||||
<ChangeTrackingRetentionUnit>Days</ChangeTrackingRetentionUnit>
|
||||
<IsEncryptionOn>False</IsEncryptionOn>
|
||||
<IsBrokerPriorityHonored>False</IsBrokerPriorityHonored>
|
||||
</Properties>
|
||||
</CatalogProperties>
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
/*
|
||||
Post-Deployment Script Template
|
||||
--------------------------------------------------------------------------------------
|
||||
This file contains SQL statements that will be appended to the build script.
|
||||
Use SQLCMD syntax to include a file in the post-deployment script.
|
||||
Example: :r .\myfile.sql
|
||||
Use SQLCMD syntax to reference a variable in the post-deployment script.
|
||||
Example: :setvar TableName MyTable
|
||||
SELECT * FROM [$(TableName)]
|
||||
--------------------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -0,0 +1,11 @@
|
||||
/*
|
||||
Pre-Deployment Script Template
|
||||
--------------------------------------------------------------------------------------
|
||||
This file contains SQL statements that will be executed before the build script.
|
||||
Use SQLCMD syntax to include a file in the pre-deployment script.
|
||||
Example: :r .\myfile.sql
|
||||
Use SQLCMD syntax to reference a variable in the pre-deployment script.
|
||||
Example: :setvar TableName MyTable
|
||||
SELECT * FROM [$(TableName)]
|
||||
--------------------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<DataSchemaModel FileFormatVersion="1.2" SchemaVersion="1.1" DspName="Microsoft.Data.Schema.Sql.Sql100DatabaseSchemaProvider" CollationLcid="1033" CollationCaseSensitive="False">
|
||||
<Header>
|
||||
<CustomData Category="ModelCapability">
|
||||
<Metadata Name="ModelCapability" Value="Default" />
|
||||
</CustomData>
|
||||
<CustomData Category="ClrTypesDbSchema" Type="DbSchema">
|
||||
<Metadata Name="ClrTypesDbSchema" Value="True" />
|
||||
</CustomData>
|
||||
<CustomData Category="AnsiNulls">
|
||||
<Metadata Name="AnsiNulls" Value="True" />
|
||||
</CustomData>
|
||||
<CustomData Category="QuotedIdentifier">
|
||||
<Metadata Name="QuotedIdentifier" Value="True" />
|
||||
</CustomData>
|
||||
<CustomData Category="CompatibilityMode">
|
||||
<Metadata Name="CompatibilityMode" Value="100" />
|
||||
</CustomData>
|
||||
<CustomData Category="Permissions" Type="XmlPermissions">
|
||||
<Metadata Name="FileName" Value="C:\PROJECTS\MYFRIENDSAROUND\MYFRIENDSAROUND.DB\PROPERTIES\DATABASE.SQLPERMISSIONS" />
|
||||
</CustomData>
|
||||
</Header>
|
||||
<Model>
|
||||
<Element Type="ISql100DatabaseOptions">
|
||||
<Property Name="Collation" Value="SQL_Latin1_General_CP1_CI_AS" />
|
||||
<Property Name="IsAnsiNullDefaultOn" Value="True" />
|
||||
<Property Name="IsAnsiNullsOn" Value="True" />
|
||||
<Property Name="IsAnsiWarningsOn" Value="True" />
|
||||
<Property Name="IsArithAbortOn" Value="True" />
|
||||
<Property Name="IsConcatNullYieldsNullOn" Value="True" />
|
||||
<Property Name="IsTornPageProtectionOn" Value="False" />
|
||||
<Property Name="IsFullTextEnabled" Value="True" />
|
||||
<Property Name="PageVerifyMode" Value="3" />
|
||||
<Relationship Name="DefaultFilegroup">
|
||||
<Entry>
|
||||
<References ExternalSource="BuiltIns" Name="[PRIMARY]" />
|
||||
</Entry>
|
||||
</Relationship>
|
||||
</Element>
|
||||
</Model>
|
||||
</DataSchemaModel>
|
||||
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<TargetDatabase>MyFriendsAround.DB</TargetDatabase>
|
||||
<DeployToDatabase>False</DeployToDatabase>
|
||||
<DeployToScript>True</DeployToScript>
|
||||
<SourceModel>MyFriendsAround.DB.dbschema</SourceModel>
|
||||
<DeployScriptFileName>MyFriendsAround.DB.sql</DeployScriptFileName>
|
||||
<DeploymentConfigurationFile>MyFriendsAround.DB_Database.sqldeployment</DeploymentConfigurationFile>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<SqlCommandVariablesFile>MyFriendsAround.DB_Database.sqlcmdvars</SqlCommandVariablesFile>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<DeploymentExtensionConfiguration Include="MyFriendsAround.DB_Script.PostDeployment.sql">
|
||||
<__PostdeploymentMetadata>
|
||||
</__PostdeploymentMetadata>
|
||||
</DeploymentExtensionConfiguration>
|
||||
<DeploymentExtensionConfiguration Include="MyFriendsAround.DB_Script.PreDeployment.sql">
|
||||
<__PredeploymentMetadata>
|
||||
</__PredeploymentMetadata>
|
||||
</DeploymentExtensionConfiguration>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<DeploymentExtension Include="Microsoft.Data.Schema.Sql.Build.SqlPlanOrderModifier">
|
||||
<Assembly>Microsoft.Data.Schema.Sql</Assembly>
|
||||
<Version>10.0.0.0</Version>
|
||||
<Token>sD9ffxHVCjo=</Token>
|
||||
</DeploymentExtension>
|
||||
<DeploymentExtension Include="Microsoft.Data.Schema.Sql.Build.SqlPrePostDeploymentModifier">
|
||||
<Assembly>Microsoft.Data.Schema.Sql</Assembly>
|
||||
<Version>10.0.0.0</Version>
|
||||
<Token>sD9ffxHVCjo=</Token>
|
||||
</DeploymentExtension>
|
||||
<DeploymentExtension Include="Microsoft.Data.Schema.Sql.Refactoring.SqlRefactoringDeploymentContributor">
|
||||
<Assembly>Microsoft.Data.Schema.Sql</Assembly>
|
||||
<Version>10.0.0.0</Version>
|
||||
<Token>sD9ffxHVCjo=</Token>
|
||||
</DeploymentExtension>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,211 @@
|
||||
/*
|
||||
Deployment script for MyFriendsAround.DB
|
||||
*/
|
||||
|
||||
GO
|
||||
SET ANSI_NULLS, ANSI_PADDING, ANSI_WARNINGS, ARITHABORT, CONCAT_NULL_YIELDS_NULL, QUOTED_IDENTIFIER ON;
|
||||
|
||||
SET NUMERIC_ROUNDABORT OFF;
|
||||
|
||||
|
||||
GO
|
||||
:setvar DatabaseName "MyFriendsAround.DB"
|
||||
:setvar DefaultDataPath ""
|
||||
:setvar DefaultLogPath ""
|
||||
|
||||
GO
|
||||
:on error exit
|
||||
GO
|
||||
USE [master]
|
||||
GO
|
||||
IF (DB_ID(N'$(DatabaseName)') IS NOT NULL
|
||||
AND DATABASEPROPERTYEX(N'$(DatabaseName)','Status') <> N'ONLINE')
|
||||
BEGIN
|
||||
RAISERROR(N'The state of the target database, %s, is not set to ONLINE. To deploy to this database, its state must be set to ONLINE.', 16, 127,N'$(DatabaseName)') WITH NOWAIT
|
||||
RETURN
|
||||
END
|
||||
|
||||
GO
|
||||
IF (DB_ID(N'$(DatabaseName)') IS NOT NULL)
|
||||
BEGIN
|
||||
ALTER DATABASE [$(DatabaseName)]
|
||||
SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
|
||||
DROP DATABASE [$(DatabaseName)];
|
||||
END
|
||||
|
||||
GO
|
||||
PRINT N'Creating $(DatabaseName)...'
|
||||
GO
|
||||
CREATE DATABASE [$(DatabaseName)] COLLATE SQL_Latin1_General_CP1_CI_AS
|
||||
GO
|
||||
EXECUTE sp_dbcmptlevel [$(DatabaseName)], 100;
|
||||
|
||||
|
||||
GO
|
||||
IF EXISTS (SELECT 1
|
||||
FROM [master].[dbo].[sysdatabases]
|
||||
WHERE [name] = N'$(DatabaseName)')
|
||||
BEGIN
|
||||
ALTER DATABASE [$(DatabaseName)]
|
||||
SET ANSI_NULLS ON,
|
||||
ANSI_PADDING ON,
|
||||
ANSI_WARNINGS ON,
|
||||
ARITHABORT ON,
|
||||
CONCAT_NULL_YIELDS_NULL ON,
|
||||
NUMERIC_ROUNDABORT OFF,
|
||||
QUOTED_IDENTIFIER ON,
|
||||
ANSI_NULL_DEFAULT ON,
|
||||
CURSOR_DEFAULT LOCAL,
|
||||
RECOVERY FULL,
|
||||
CURSOR_CLOSE_ON_COMMIT OFF,
|
||||
AUTO_CREATE_STATISTICS ON,
|
||||
AUTO_SHRINK OFF,
|
||||
AUTO_UPDATE_STATISTICS ON,
|
||||
RECURSIVE_TRIGGERS OFF
|
||||
WITH ROLLBACK IMMEDIATE;
|
||||
ALTER DATABASE [$(DatabaseName)]
|
||||
SET AUTO_CLOSE OFF
|
||||
WITH ROLLBACK IMMEDIATE;
|
||||
END
|
||||
|
||||
|
||||
GO
|
||||
IF EXISTS (SELECT 1
|
||||
FROM [master].[dbo].[sysdatabases]
|
||||
WHERE [name] = N'$(DatabaseName)')
|
||||
BEGIN
|
||||
ALTER DATABASE [$(DatabaseName)]
|
||||
SET ALLOW_SNAPSHOT_ISOLATION OFF;
|
||||
END
|
||||
|
||||
|
||||
GO
|
||||
IF EXISTS (SELECT 1
|
||||
FROM [master].[dbo].[sysdatabases]
|
||||
WHERE [name] = N'$(DatabaseName)')
|
||||
BEGIN
|
||||
ALTER DATABASE [$(DatabaseName)]
|
||||
SET READ_COMMITTED_SNAPSHOT OFF;
|
||||
END
|
||||
|
||||
|
||||
GO
|
||||
IF EXISTS (SELECT 1
|
||||
FROM [master].[dbo].[sysdatabases]
|
||||
WHERE [name] = N'$(DatabaseName)')
|
||||
BEGIN
|
||||
ALTER DATABASE [$(DatabaseName)]
|
||||
SET AUTO_UPDATE_STATISTICS_ASYNC OFF,
|
||||
PAGE_VERIFY NONE,
|
||||
DATE_CORRELATION_OPTIMIZATION OFF,
|
||||
DISABLE_BROKER,
|
||||
PARAMETERIZATION SIMPLE,
|
||||
SUPPLEMENTAL_LOGGING OFF
|
||||
WITH ROLLBACK IMMEDIATE;
|
||||
END
|
||||
|
||||
|
||||
GO
|
||||
IF IS_SRVROLEMEMBER(N'sysadmin') = 1
|
||||
BEGIN
|
||||
IF EXISTS (SELECT 1
|
||||
FROM [master].[dbo].[sysdatabases]
|
||||
WHERE [name] = N'$(DatabaseName)')
|
||||
BEGIN
|
||||
EXECUTE sp_executesql N'ALTER DATABASE [$(DatabaseName)]
|
||||
SET TRUSTWORTHY OFF,
|
||||
DB_CHAINING OFF
|
||||
WITH ROLLBACK IMMEDIATE';
|
||||
END
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
PRINT N'The database settings cannot be modified. You must be a SysAdmin to apply these settings.';
|
||||
END
|
||||
|
||||
|
||||
GO
|
||||
IF IS_SRVROLEMEMBER(N'sysadmin') = 1
|
||||
BEGIN
|
||||
IF EXISTS (SELECT 1
|
||||
FROM [master].[dbo].[sysdatabases]
|
||||
WHERE [name] = N'$(DatabaseName)')
|
||||
BEGIN
|
||||
EXECUTE sp_executesql N'ALTER DATABASE [$(DatabaseName)]
|
||||
SET HONOR_BROKER_PRIORITY OFF
|
||||
WITH ROLLBACK IMMEDIATE';
|
||||
END
|
||||
END
|
||||
ELSE
|
||||
BEGIN
|
||||
PRINT N'The database settings cannot be modified. You must be a SysAdmin to apply these settings.';
|
||||
END
|
||||
|
||||
|
||||
GO
|
||||
USE [$(DatabaseName)]
|
||||
GO
|
||||
IF fulltextserviceproperty(N'IsFulltextInstalled') = 1
|
||||
EXECUTE sp_fulltext_database 'enable';
|
||||
|
||||
|
||||
GO
|
||||
/*
|
||||
Pre-Deployment Script Template
|
||||
--------------------------------------------------------------------------------------
|
||||
This file contains SQL statements that will be executed before the build script.
|
||||
Use SQLCMD syntax to include a file in the pre-deployment script.
|
||||
Example: :r .\myfile.sql
|
||||
Use SQLCMD syntax to reference a variable in the pre-deployment script.
|
||||
Example: :setvar TableName MyTable
|
||||
SELECT * FROM [$(TableName)]
|
||||
--------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
GO
|
||||
-- Refactoring step to update target server with deployed transaction logs
|
||||
CREATE TABLE [dbo].[__RefactorLog] (OperationKey UNIQUEIDENTIFIER NOT NULL PRIMARY KEY)
|
||||
GO
|
||||
sp_addextendedproperty N'microsoft_database_tools_support', N'refactoring log', N'schema', N'dbo', N'table', N'__RefactorLog'
|
||||
GO
|
||||
|
||||
GO
|
||||
/*
|
||||
Post-Deployment Script Template
|
||||
--------------------------------------------------------------------------------------
|
||||
This file contains SQL statements that will be appended to the build script.
|
||||
Use SQLCMD syntax to include a file in the post-deployment script.
|
||||
Example: :r .\myfile.sql
|
||||
Use SQLCMD syntax to reference a variable in the post-deployment script.
|
||||
Example: :setvar TableName MyTable
|
||||
SELECT * FROM [$(TableName)]
|
||||
--------------------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
GO
|
||||
IF EXISTS (SELECT 1
|
||||
FROM [master].[dbo].[sysdatabases]
|
||||
WHERE [name] = N'$(DatabaseName)')
|
||||
BEGIN
|
||||
DECLARE @VarDecimalSupported AS BIT;
|
||||
SELECT @VarDecimalSupported = 0;
|
||||
IF ((ServerProperty(N'EngineEdition') = 3)
|
||||
AND (((@@microsoftversion / power(2, 24) = 9)
|
||||
AND (@@microsoftversion & 0xffff >= 3024))
|
||||
OR ((@@microsoftversion / power(2, 24) = 10)
|
||||
AND (@@microsoftversion & 0xffff >= 1600))))
|
||||
SELECT @VarDecimalSupported = 1;
|
||||
IF (@VarDecimalSupported > 0)
|
||||
BEGIN
|
||||
EXECUTE sp_db_vardecimal_storage_format N'$(DatabaseName)', 'ON';
|
||||
END
|
||||
END
|
||||
|
||||
|
||||
GO
|
||||
ALTER DATABASE [$(DatabaseName)]
|
||||
SET MULTI_USER
|
||||
WITH ROLLBACK IMMEDIATE;
|
||||
|
||||
|
||||
GO
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<SqlCommandVariables xmlns="urn:Microsoft.VisualStudio.Data.Schema.Package.SqlCmdVars" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<Version>1.0</Version>
|
||||
<Properties>
|
||||
</Properties>
|
||||
</SqlCommandVariables>
|
||||
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<DeploymentConfigurationSettings xmlns="urn:Microsoft.VisualStudio.Data.Schema.Package.DeploymentConfigurationSettings" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<Version>1.0</Version>
|
||||
<Properties>
|
||||
<AlwaysCreateNewDatabase>False</AlwaysCreateNewDatabase>
|
||||
<BlockIncrementalDeploymentIfDataLoss>True</BlockIncrementalDeploymentIfDataLoss>
|
||||
<DeployDatabaseProperties>True</DeployDatabaseProperties>
|
||||
<DeploymentCollationPreference>UseSourceModelCollation</DeploymentCollationPreference>
|
||||
<DoNotUseAlterAssemblyStatementsToUpdateCLRTypes>False</DoNotUseAlterAssemblyStatementsToUpdateCLRTypes>
|
||||
<GenerateDropsIfNotInProject>False</GenerateDropsIfNotInProject>
|
||||
<PerformDatabaseBackup>False</PerformDatabaseBackup>
|
||||
<SingleUserMode>False</SingleUserMode>
|
||||
</Properties>
|
||||
</DeploymentConfigurationSettings>
|
||||
@@ -0,0 +1,52 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<CatalogProperties xmlns="urn:Microsoft.VisualStudio.Data.Schema.Package.CatalogProperties" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||
<Version>1.0</Version>
|
||||
<Properties>
|
||||
<!--Sql Server 2000-->
|
||||
<DefaultCollation>SQL_Latin1_General_CP1_CI_AS</DefaultCollation>
|
||||
<AnsiNullDefault>True</AnsiNullDefault>
|
||||
<AnsiNulls>True</AnsiNulls>
|
||||
<AnsiPadding>True</AnsiPadding>
|
||||
<AnsiWarnings>True</AnsiWarnings>
|
||||
<ArithAbort>True</ArithAbort>
|
||||
<ConcatNullYieldsNull>True</ConcatNullYieldsNull>
|
||||
<QuotedIdentifier>True</QuotedIdentifier>
|
||||
<NumericRoundAbort>False</NumericRoundAbort>
|
||||
<RecursiveTriggersEnabled>False</RecursiveTriggersEnabled>
|
||||
<DatabaseState>ONLINE</DatabaseState>
|
||||
<UpdateOptions>READ_WRITE</UpdateOptions>
|
||||
<CloseCursorOnCommitEnabled>False</CloseCursorOnCommitEnabled>
|
||||
<DefaultCursor>LOCAL</DefaultCursor>
|
||||
<AutoClose>False</AutoClose>
|
||||
<AutoCreateStatistics>True</AutoCreateStatistics>
|
||||
<AutoShrink>False</AutoShrink>
|
||||
<AutoUpdateStatistics>True</AutoUpdateStatistics>
|
||||
<TornPageDetection>False</TornPageDetection>
|
||||
<DatabaseAccess>MULTI_USER</DatabaseAccess>
|
||||
<Recovery>FULL</Recovery>
|
||||
<EnableFullTextSearch>True</EnableFullTextSearch>
|
||||
<DatabaseChaining>False</DatabaseChaining>
|
||||
<DefaultFilegroup>PRIMARY</DefaultFilegroup>
|
||||
<!--Sql Server 2005-->
|
||||
<!--<CompatibilityMode></CompatibilityMode>-->
|
||||
<Trustworthy>False</Trustworthy>
|
||||
<AutoUpdateStatisticsAsynchronously>False</AutoUpdateStatisticsAsynchronously>
|
||||
<PageVerify>NONE</PageVerify>
|
||||
<ServiceBrokerOption>DisableBroker</ServiceBrokerOption>
|
||||
<DateCorrelationOptimizationOn>False</DateCorrelationOptimizationOn>
|
||||
<Parameterization>SIMPLE</Parameterization>
|
||||
<AllowSnapshotIsolation>False</AllowSnapshotIsolation>
|
||||
<ReadCommittedSnapshot>False</ReadCommittedSnapshot>
|
||||
<VardecimalStorageFormatOn>True</VardecimalStorageFormatOn>
|
||||
<SupplementalLoggingOn>False</SupplementalLoggingOn>
|
||||
<!--Sql Server 2008-->
|
||||
<DefaultFileStreamFilegroup></DefaultFileStreamFilegroup>
|
||||
<IsChangeTrackingOn>False</IsChangeTrackingOn>
|
||||
<IsChangeTrackingAutoCleanupOn>True</IsChangeTrackingAutoCleanupOn>
|
||||
<ChangeTrackingRetentionPeriod>2</ChangeTrackingRetentionPeriod>
|
||||
<ChangeTrackingRetentionUnit>Days</ChangeTrackingRetentionUnit>
|
||||
<IsEncryptionOn>False</IsEncryptionOn>
|
||||
<IsBrokerPriorityHonored>False</IsBrokerPriorityHonored>
|
||||
</Properties>
|
||||
</CatalogProperties>
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
/*
|
||||
Post-Deployment Script Template
|
||||
--------------------------------------------------------------------------------------
|
||||
This file contains SQL statements that will be appended to the build script.
|
||||
Use SQLCMD syntax to include a file in the post-deployment script.
|
||||
Example: :r .\myfile.sql
|
||||
Use SQLCMD syntax to reference a variable in the post-deployment script.
|
||||
Example: :setvar TableName MyTable
|
||||
SELECT * FROM [$(TableName)]
|
||||
--------------------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -0,0 +1,11 @@
|
||||
/*
|
||||
Pre-Deployment Script Template
|
||||
--------------------------------------------------------------------------------------
|
||||
This file contains SQL statements that will be executed before the build script.
|
||||
Use SQLCMD syntax to include a file in the pre-deployment script.
|
||||
Example: :r .\myfile.sql
|
||||
Use SQLCMD syntax to reference a variable in the pre-deployment script.
|
||||
Example: :setvar TableName MyTable
|
||||
SELECT * FROM [$(TableName)]
|
||||
--------------------------------------------------------------------------------------
|
||||
*/
|
||||
Reference in New Issue
Block a user