# Database review update — 8 October 2026

## Existing installation: data না মুছে update

1. cPanel/phpMyAdmin থেকে database Export করে SQL backup রাখুন। File Manager থেকে আপনার বর্তমান application folder-এর backup রাখুন।
2. ZIP কম্পিউটারে extract করুন। Node application root-এ app.js, core.js, database-health.js, validation.cjs, package.json ও package-lock.json replace/add করুন।
3. আপনার hosting-এর .env, storage/config.json, storage/uploads এবং database অপরিবর্তিত রাখুন। Install আবার চালাবেন না; database.sql import করবেন না।
4. Setup Node.js App-এ Run NPM Install দিন। zod এখন runtime dependency, তাই এই ধাপ প্রয়োজন। তারপর Restart দিন। কোনো terminal বা frontend build প্রয়োজন নেই।
5. Domain Document Root-এ পুরোনো development index.html থাকলে index-source-backup.html নামে rename করুন। dist/index.html rename করবেন না। Domain document root ও Node application root আলাদা রাখুন; Node root public_html-এর বাইরে রাখুন।
6. Browser DevTools-এ Offline থাকলে No throttling করুন। Ctrl+Shift+R দিয়ে reload করে login করুন।
7. /log-checker খুলুন। Database checks-এর ফল পড়ুন এবং Download database report চাপুন। CHECK REQUIRED থাকলে সেই report দিন। এটি passwords, names, contacts বা record contents দেয় না।

## কী সংশোধিত হয়েছে

- Frontend-এর একই schema দিয়ে backend birth details, dates, coordinates, identities, travel, social URLs ও resume validate করে। অসম্পূর্ণ valid records-এ default fields দেওয়া হয়। Invalid input database-এ পৌঁছানোর আগে বাতিল হয়।
- Profile ও resume update row-lock transaction ব্যবহার করে, ফলে একই সময়ে save হলে resume/profile overwrite-এর নির্দিষ্ট race দূর হয়। একই profile-এর একই field দুই client edit করলে সর্বশেষ save কার্যকর হয়; এটি version-conflict editor নয়।
- Record-number allocation বর্তমান সর্বোচ্চ ID ও sequence দুটো দেখে। পিছিয়ে থাকা sequence পরবর্তী person create-এর transaction-এ এগিয়ে যায়; existing IDs বদলায় না। প্রথম record 1। Delete-এর পরে পুরোনো IDs পুনর্ব্যবহার হয় না।
- Relationship creation এবং import একই account-এর জন্য serialize হয়, duplicate-check একই transaction-এ হয়।
- Person deletion-এর সঙ্গে file/share creation সংঘর্ষ হলে orphan row তৈরি ঠেকাতে person row lock ব্যবহার হয়।
- Database checker connection, required columns, InnoDB, Unicode, unique record-number index, next ID, orphan links, duplicate relationships ও saved person validation পরীক্ষা করে। User-data checks শুধু logged-in account-এর জন্য।
- Fresh ZIP-এ root development index.html নেই। source-index.html source হিসেবে আছে। npm run build অস্থায়ী entry তৈরি করে পরে সরিয়ে দেয়। dist/index.html production entry।

## পরীক্ষার সীমা

18 automated tests passed; Node syntax checks and production build passed.
এই tests validation, password hashing, private-file blocking, CSRF, installer guards, sharing visibility ও diagnostic failure handling পরীক্ষা করে।
এই পরিবেশে MySQL/MariaDB server চালানো যায়নি। আপনার live database connection, SQL transactions এবং actual schema end-to-end পরীক্ষা হয়নি। নতুন checker চালিয়ে hosting-এর ফল নিতে হবে।
Checker read-only; missing columns, wrong types, duplicate rows বা damaged data নিজে থেকে delete/rewrite করে না। Column উপস্থিতি পরীক্ষা হয়, প্রতিটি column-এর exact SQL type/default ও সব index/FK সম্পূর্ণ যাচাই নয়। এটি full DBA audit বা corruption-repair tool নয়।

## Hosting-এ functional check

Backup রাখার পরে একটি test person যোগ করুন; বাংলা ও আরবি নাম, birth time, birthday, latitude/longitude দিন। Save করে reload করুন, তারপর edit করুন। দ্বিতীয় test person-এর সঙ্গে relation যোগ করে উভয় profile-এ দেখুন। Resume save করে profile edit করার পরে resume আবার খুলুন। নিজের test record-এর file upload/download করুন। Public link নিজের test data দিয়ে enable, তারপর hide করে link আর খোলে না যাচাই করুন। ইচ্ছাকৃত test records চাইলে UI দিয়ে delete করে আবার reload করুন। আসল ব্যক্তিগত তথ্য public করে test করবেন না।

কোনো ধাপে error হলে Log checker report ও দৃশ্যমান error জানান। Database password বা .env পাঠাবেন না।
