Recreating the dropped table using Prisma and PostgreSQL

Following command will do a soft reset

This command will drop all tables and Recreate Schema with correct column order.

After that, following command will recreate the migration for version control

How to avoid prefixing every table with schema name while creating new tables ?

Lets assume schema name is my_data. If we want to avoid prefixing every table with my_data while creating a new table, we can set it in the search_path.

Now we can create a new table like this.

By using the above code, courses table will be created in my_data by default.

What command we need to use to list all schemas in the current PostgreSQL Database ?

This command is used to list All Schemas in the current PostgreSQL Database along with their owners.

The \dn command is a PostgreSQL-specific meta-command used inside the psql command-line interface.

The default schema is usually public. Generally we use /dn to check existing schemas.