appwrite-utils-cli 0.0.273 → 0.0.274
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/README.md
CHANGED
@@ -118,6 +118,7 @@ This setup ensures that developers have robust tools at their fingertips to mana
|
|
118
118
|
|
119
119
|
### Changelog
|
120
120
|
|
121
|
+
- 0.0.274: Small improvement for attribute handling, rather than getting it every attribute, I check the collections attributes
|
121
122
|
- 0.0.273: Small fix for relationship attribute comparisons
|
122
123
|
- 0.0.272: That's what I get for not testing lmao, also updated logic for checking for existing attributes to take the `format` into consideration from the database (URL's are not of `type: "url"`, they are of `format: "url"`)
|
123
124
|
- 0.0.271: Small change to update attributes that are different from each other by deleting the attribute and recreating, as we cannot update most things
|
@@ -39,7 +39,9 @@ export const createOrUpdateAttribute = async (db, dbId, collection, attribute) =
|
|
39
39
|
let action = "create";
|
40
40
|
let foundAttribute;
|
41
41
|
try {
|
42
|
-
foundAttribute =
|
42
|
+
foundAttribute = parseAttribute(collection.attributes.find(
|
43
|
+
// @ts-expect-error
|
44
|
+
(attr) => attr.key === attribute.key));
|
43
45
|
foundAttribute = parseAttribute(foundAttribute);
|
44
46
|
}
|
45
47
|
catch (error) {
|
@@ -173,7 +173,7 @@ export const createOrUpdateCollections = async (database, databaseId, config, de
|
|
173
173
|
}
|
174
174
|
}
|
175
175
|
else {
|
176
|
-
console.log(`Collection ${collection.name}
|
176
|
+
console.log(`Collection ${collection.name} exists, using it`);
|
177
177
|
}
|
178
178
|
// Update attributes and indexes for the collection
|
179
179
|
console.log("Creating Attributes");
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "appwrite-utils-cli",
|
3
3
|
"description": "Appwrite Utility Functions to help with database management, data conversion, data import, migrations, and much more. Meant to be used as a CLI tool, I do not recommend installing this in frontend environments.",
|
4
|
-
"version": "0.0.
|
4
|
+
"version": "0.0.274",
|
5
5
|
"main": "src/main.ts",
|
6
6
|
"type": "module",
|
7
7
|
"repository": {
|
@@ -55,7 +55,12 @@ export const createOrUpdateAttribute = async (
|
|
55
55
|
let action = "create";
|
56
56
|
let foundAttribute;
|
57
57
|
try {
|
58
|
-
foundAttribute =
|
58
|
+
foundAttribute = parseAttribute(
|
59
|
+
collection.attributes.find(
|
60
|
+
// @ts-expect-error
|
61
|
+
(attr) => attr.key === attribute.key
|
62
|
+
) as unknown as Attribute
|
63
|
+
);
|
59
64
|
foundAttribute = parseAttribute(foundAttribute);
|
60
65
|
} catch (error) {
|
61
66
|
foundAttribute = undefined;
|
@@ -234,7 +234,7 @@ export const createOrUpdateCollections = async (
|
|
234
234
|
continue; // Skip to the next collection on failure
|
235
235
|
}
|
236
236
|
} else {
|
237
|
-
console.log(`Collection ${collection.name}
|
237
|
+
console.log(`Collection ${collection.name} exists, using it`);
|
238
238
|
}
|
239
239
|
|
240
240
|
// Update attributes and indexes for the collection
|