@automattic/vip 3.8.6 → 3.8.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/dev-env-sync-sql.js +17 -2
- package/docs/CHANGELOG.md +12 -1
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
|
@@ -213,6 +213,20 @@ class DevEnvSyncSQLCommand {
|
|
|
213
213
|
if (!networkSites) {
|
|
214
214
|
return;
|
|
215
215
|
}
|
|
216
|
+
const prologue = `
|
|
217
|
+
DROP PROCEDURE IF EXISTS vip_sync_update_blog_domains;
|
|
218
|
+
DELIMITER $$
|
|
219
|
+
CREATE PROCEDURE vip_sync_update_blog_domains()
|
|
220
|
+
BEGIN
|
|
221
|
+
IF EXISTS (SELECT * FROM information_schema.tables WHERE table_schema = 'wordpress' AND table_name = 'wp_blogs') THEN
|
|
222
|
+
`;
|
|
223
|
+
const epilogue = `
|
|
224
|
+
END IF;
|
|
225
|
+
END$$
|
|
226
|
+
DELIMITER ;
|
|
227
|
+
CALL vip_sync_update_blog_domains();
|
|
228
|
+
DROP PROCEDURE vip_sync_update_blog_domains;
|
|
229
|
+
`;
|
|
216
230
|
const queries = [];
|
|
217
231
|
for (const site of networkSites) {
|
|
218
232
|
if (!site?.blogId || !site?.homeUrl) {
|
|
@@ -220,10 +234,11 @@ class DevEnvSyncSQLCommand {
|
|
|
220
234
|
}
|
|
221
235
|
const oldDomain = new URL(site.homeUrl).hostname;
|
|
222
236
|
const newDomain = site.blogId !== 1 ? `${this.slugifyDomain(oldDomain)}.${this.landoDomain}` : this.landoDomain;
|
|
223
|
-
queries.push(`UPDATE wp_blogs SET domain = '${newDomain}' WHERE blog_id = ${Number(site.blogId)};`);
|
|
237
|
+
queries.push(` UPDATE wp_blogs SET domain = '${newDomain}' WHERE blog_id = ${Number(site.blogId)};`);
|
|
224
238
|
}
|
|
225
239
|
if (queries.length) {
|
|
226
|
-
|
|
240
|
+
const sql = `${prologue}\n${queries.join('\n')}\n${epilogue}`;
|
|
241
|
+
await _fs.default.promises.appendFile(this.sqlFile, sql);
|
|
227
242
|
}
|
|
228
243
|
}
|
|
229
244
|
|
package/docs/CHANGELOG.md
CHANGED
|
@@ -1,8 +1,19 @@
|
|
|
1
1
|
## Changelog
|
|
2
2
|
|
|
3
|
+
## 3.8.7
|
|
4
|
+
|
|
5
|
+
* fix(dev-env): SQL sync for single sites
|
|
6
|
+
|
|
7
|
+
**Full Changelog**: https://github.com/Automattic/vip-cli/compare/3.8.6...3.8.7
|
|
8
|
+
|
|
9
|
+
## 3.8.6
|
|
10
|
+
|
|
11
|
+
* Updating Node.js versions and standardize the format
|
|
12
|
+
|
|
13
|
+
**Full Changelog**: https://github.com/Automattic/vip-cli/compare/3.8.5...3.8.6
|
|
14
|
+
|
|
3
15
|
## 3.8.5
|
|
4
16
|
|
|
5
|
-
## What's Changed
|
|
6
17
|
* build(deps-dev): bump the babel group with 4 updates
|
|
7
18
|
* build(deps-dev): bump typescript from 5.6.2 to 5.6.3
|
|
8
19
|
* Update the sync command to follow the VIP-CLI style guide
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@automattic/vip",
|
|
3
|
-
"version": "3.8.
|
|
3
|
+
"version": "3.8.7",
|
|
4
4
|
"lockfileVersion": 2,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@automattic/vip",
|
|
9
|
-
"version": "3.8.
|
|
9
|
+
"version": "3.8.7",
|
|
10
10
|
"hasInstallScript": true,
|
|
11
11
|
"license": "MIT",
|
|
12
12
|
"dependencies": {
|