Posts

Delete Migration and its history

Delete Migration and its history  I f you want to  delete the migration and its history  (so it's like it never existed), do the following: Delete the migration folder: rm   -rf   libs/api/data-access-db/src/lib/migrations/2025070 9143108_update_enums Remove the migration record from the database: If you use Prisma, run this SQL in your database (using  psql  or a GUI): DELETE   FROM   "_prisma_migrations"   WHERE  migration_name  =   '20250709143108_update_enums' ; This will remove the migration from both your codebase and the migration history table.

Set dynamic input fields in React

 Example for Input type text: const [ videoUrls , setVideoUrls ] = useState ([{ id : 0 , url : '' }]) const addVideoField = () => { setVideoUrls ([ ... videoUrls , { id : videoUrls . length , url : '' }]) } const handleVideoUrlChange = ( id , value ) => { const updatedUrls = videoUrls . map ( video => ( video . id === id ? { ... video , url : value } : video )) setVideoUrls ( updatedUrls ) < div id = '' > < Grid container direction = 'row' alignItems = 'normal' spacing = { 4 } sx = { { pl : 5 , pr : 5 , pt : 3 , pb : 2 } } > < Grid item sm = { 12 } sx = { { pl : 5 , pr : 5 , pt : 3 , pb : 2 } } > { videoUrls . map (( field , ...

Commands for setting up and running a development environment

- yarn nx reset: (Resets the Nx cache, which can help resolve issues with stale builds); - yarn cache clean: (Clears Yarn’s cache to ensure that dependencies are freshly installed) - rm -rf node_modules: (Deletes the node_modules and .yarn directories to remove all installed dependencies and Yarn’s internal files) - yarn install: (Installs the project's dependencies from package.json); - yarn db:docker: (Likely starts a database using Docker (e.g., PostgreSQL, MySQL, or MongoDB); - yarn db:up: (Likely brings up the database container if it's using Docker Compose) - yarn db:dev-migrate: (Runs database migrations for the development environment) - yarn start:dev: (Starts the development server)

Clone GitHub repository to SourceTree

Image
To clone a GitHub repository to SourceTree , follow these steps: Step 1: Copy the Repository URL Go to the GitHub (or any Git hosting platform) repository page. Click the green "Code" button. Copy the HTTPS URL (or SSH URL if you have SSH set up). Step 2: Open SourceTree Open SourceTree on your computer. Step 3: Clone the Repository Click on "Clone" from the top menu. In the "Source URL" field, paste the URL you copied. Choose a "Destination Path" (the folder where you want the repo to be saved). Click "Clone" .  

React Native

Image
 Install React Native Project Step-by-Step Solution: Step 1 : Install Java Development Kit (JDK) React Native requires the Java Development Kit (JDK) to build the Android app. - Download and install the JDK from the official Oracle website or use AdoptOpenJDK : Oracle JDK : Download Oracle JDK AdoptOpenJDK : Download AdoptOpenJDK -After installation, you need to configure the environment variables for Java. Step 2 : Set Up Java Environment Variables On macOS, you can configure Java environment variables in your .bash_profile or .zshrc (depending on your shell). Open your terminal and open your shell profile: For bash : nano ~/.bash_profile For zsh (default on newer macOS versions): nano ~/.zshrc Add the following lines to set the Java environment variables (adjust the path to where JDK is installed): export ANDROID_HOME=/Users/ionut/Library/Android/sdk export PATH=$ANDROID_HOME/emulator:$ANDROID_HOME/platform-tools:$ANDROID_HOME/cmdline-tools/latest/bin:$PATH Save the file ...