Skip to content

Commit 6fee48a

Browse files
committed
automatically copy dacpac to database folder
1 parent b63c94d commit 6fee48a

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

database/SessionRecommender/Tables/sessions.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ CREATE TABLE [web].[sessions] (
22
[id] INT DEFAULT (NEXT VALUE FOR [web].[global_id]) NOT NULL,
33
[title] NVARCHAR (200) NOT NULL,
44
[abstract] NVARCHAR (MAX) NOT NULL,
5-
[external_id] VARCHAR (100) COLLATE Latin1_General_100_BIN2 NULL,
5+
[external_id] VARCHAR (100) COLLATE Latin1_General_100_BIN2 NOT NULL,
66
[last_fetched] DATETIME2 (7) NULL,
7-
[start_time_PST] DATETIME2 (0) NULL,
8-
[end_time_PST] DATETIME2 (0) NULL,
7+
[start_time_PST] DATETIME2 (0) NOT NULL,
8+
[end_time_PST] DATETIME2 (0) NOT NULL,
99
[tags] NVARCHAR (MAX) NULL,
1010
[recording_url] VARCHAR (1000) NULL,
1111
[require_embeddings_update] BIT DEFAULT ((0)) NOT NULL,

database/SessionRecommender/session_recommender_v2.sqlproj

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
<DSP>Microsoft.Data.Tools.Schema.Sql.SqlAzureV12DatabaseSchemaProvider</DSP>
88
<ModelCollation>1033, CI</ModelCollation>
99
<IsChangeTrackingOn>True</IsChangeTrackingOn>
10+
<BuildDependsOn>CopyDacpac</BuildDependsOn>
1011
</PropertyGroup>
1112
<ItemGroup>
1213
<PackageReference Include="Microsoft.SqlServer.Dacpacs.Azure.Master">
@@ -40,11 +41,13 @@
4041
<ItemGroup>
4142
<PostDeploy Include="Script.PostDeployment.sql" />
4243
</ItemGroup>
43-
<Target Name="BeforeBuild">
44-
<Delete Files="$(BaseIntermediateOutputPath)\project.assets.json" />
45-
</Target>
46-
<Target Name="AfterBuild">
44+
<ItemGroup>
45+
<DeploySpecificFolders Include="$(OutputPath)\*.dacpac">
46+
<FolderToCopyTo>$(ProjectDir)/../</FolderToCopyTo>
47+
</DeploySpecificFolders>
48+
</ItemGroup>
49+
<Target Name="CopyDacpac" AfterTargets="Build">
4750
<Message Text="Copying dacpacs..." Importance="high"/>
48-
<Copy SourceFiles="$(OutputPath)\*.dacpac" DestinationFolder="$(OutputPath)\..\..\.."/>
51+
<Copy SourceFiles="@(DeploySpecificFolders)" DestinationFolder="%(DeploySpecificFolders.FolderToCopyTo)"/>
4952
</Target>
5053
</Project>
23 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)