Post content
🔧Error Fixer Bot🔧 This is a temporary bot to fix a usual error. Most of you maybe getting an error "psycopg2.errors.NumericValueOutOfRange" while deploying some bots including my old bots. This bot will help you fix it. Why does it occur? Telegram User IDs used to be 32-bit integers. But as it's growing popular, it's not enough now. Anyhow, the IDs are now 64-bit integers. 32-bit and 64-bit play a very important role in systems, therefore in programming languages and databases. Old bots saved IDs as 32-bit integers. New IDs are 64-bit and therefore can't be added to those particular columns of database. That is why, bot throws an exception. How to fix it? Database Columns have a particular type. Sqlalchemy (python sql library) saves 32-bit integers in a column type called "Integer" and 64-bit integers in a column type called "BigInteger". The way to fix it is just to change the column type from Integer to BigInteger. How to use the bot? Send the command 'fix' with your DATABASE_URL. Please note that database URL is a special private key. Anyone with access to it can change the data in your database. So, use the bot only if you trust us. Example /fix your_database_url Why don't developers fix their repositories? Because we are too lazy! What else? If the URL is correct, the bot'll fix it. But please note that it fixes the database, not the code. If you'll not redeploy from the same code then you don't need to do anything. Otherwise you need to change "Integer" to "BigInteger" in the code. In my repositories, there's a folder called database. Just change it's code in your fork. If you also got "RollbackError", please restart the bot. Username - @DatabaseMigrationBot