Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Bug Report: migrated database attributes (string ) failed to create index #2596

Closed
2 tasks done
prooshani opened this issue Jan 10, 2022 · 3 comments
Closed
2 tasks done
Labels
product / databases Fixes and upgrades for the Appwrite Database. question Further information is requested stale

Comments

@prooshani
Copy link

👟 Reproduction steps

After upgrading to 0.12 and migrating my databases (collections), string attributes are converting with length of 65535.
If you decide to add index to the collection for queries with type of KEY and having more than one attribute then you will face a failed index and the index is not gonna work for queries as well.
But, if I define a similar dataTable (collection) with string attributes length 255, it is looking good.
For the first scenario (large string attribute) the database worker having error like this:
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 3072 bytes

👍 Expected behavior

Screen Shot 2022-01-10 at 10 42 28 PM

👎 Actual Behavior

Screen Shot 2022-01-10 at 10 41 54 PM 1

🎲 Appwrite version

Version 0.11.x

💻 Operating system

MacOS

🧱 Your Environment

No response

👀 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

@ghost ghost assigned kodumbeats Jan 10, 2022
@kodumbeats kodumbeats transferred this issue from appwrite/sdk-generator Jan 12, 2022
@eldadfux eldadfux added the product / databases Fixes and upgrades for the Appwrite Database. label Jan 18, 2022
@Meldiron
Copy link
Contributor

Some time ago I wrote a CLI toolset Appwrite Tools that is capable of solving this issue.

You can follow README in the repo to see how to use it, but it's pretty much:

  1. Clone repo git clone (and enter folder)
  2. Install dependencies npm install
  3. Backup documents into a file (command in README with --action documents-backup)
  4. Make sure your documents are properly downloaded in backup_[SOME_NUMBER].csv file
  5. Wipe documents in Appwrite (command in README with --action documents-wipe)
  6. Go into Appwrite Console, and manually delete attributes. Then add them back with the new size you want
  7. Restore documents (command in README with --action documents-restore)

You should now have exactly the same data in your collection, and your attribute size is now changed. This CLI tool can also allow you to change types or even names of attributes, but you might need to do some manual changes to the document backup (in CSV) to follow new names/types.

@stnguyen90 stnguyen90 added the question Further information is requested label Jun 19, 2024
Copy link

This issue has been labeled as a 'question', indicating that it requires additional information from the requestor. It has been inactive for 7 days. If no further activity occurs, this issue will be closed in 14 days.

@github-actions github-actions bot added the stale label Jun 27, 2024
Copy link

This issue has been closed due to inactivity. If you still require assistance, please provide the requested information.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product / databases Fixes and upgrades for the Appwrite Database. question Further information is requested stale
Projects
None yet
Development

No branches or pull requests

5 participants