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)
86
86
// Copy our blank(ish) wal mode sqlite database to its final location.
87
87
try
88
88
{
89
+ EnsureDatabaseDirectory ( original . DataSource ) ;
89
90
File . Copy ( tempFile , original . DataSource , true ) ;
90
91
}
91
92
catch ( Exception ex )
@@ -104,4 +105,13 @@ public void Create(string connectionString)
104
105
_logger . LogWarning ( ex , "Unable to cleanup temporary sqlite database file {path}" , tempFile ) ;
105
106
}
106
107
}
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
+ }
107
117
}
You can’t perform that action at this time.
0 commit comments