File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
src/Umbraco.Cms.Persistence.Sqlite/Services Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -86,6 +86,7 @@ public void Create(string connectionString)
8686 // Copy our blank(ish) wal mode sqlite database to its final location.
8787 try
8888 {
89+ EnsureDatabaseDirectory ( original . DataSource ) ;
8990 File . Copy ( tempFile , original . DataSource , true ) ;
9091 }
9192 catch ( Exception ex )
@@ -104,4 +105,13 @@ public void Create(string connectionString)
104105 _logger . LogWarning ( ex , "Unable to cleanup temporary sqlite database file {path}" , tempFile ) ;
105106 }
106107 }
108+
109+ private static void EnsureDatabaseDirectory ( string dataSource )
110+ {
111+ var directoryPath = Path . GetDirectoryName ( dataSource ) ;
112+ if ( string . IsNullOrEmpty ( directoryPath ) is false && Directory . Exists ( directoryPath ) is false )
113+ {
114+ Directory . CreateDirectory ( directoryPath ) ;
115+ }
116+ }
107117}
You can’t perform that action at this time.
0 commit comments