If I have two devs working on an application and I want to make sure they cannot see each others work. Can I set up two different schemas?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Heya @bigdarkbluecrab,
Yes, you can set up two different schemas in a database to segregate the work of two developers. This approach allows each developer to have a separate namespace where they can create, modify, and manage database objects (like tables, views, stored procedures, etc.) without interfering with each other’s work. Here’s how this can be done and some considerations to keep in mind:
Setting Up Separate Schemas
Create Schemas: First, create two separate schemas in your database, one for each developer. The process of creating a schema varies depending on the database management system (DBMS) you’re using. For example, in SQL Server or PostgreSQL, you would use the
CREATE SCHEMA
statement.Assign Permissions: Assign appropriate permissions to each developer for their respective schema. Ensure that each developer has full control over their schema but no or limited access to the other’s schema.
Schema Usage: Instruct each developer to create and work with database objects within their own schema. This ensures that their activities are isolated from each other.
Additionally, every managed database instance has a how-to/modify-user-privileges article which you can go over as soon as you decide on a DB you want to use,
https://docs.digitalocean.com/products/databases/
Hi there,
Yes, you can set up two different schemas to ensure that two developers working on an application do not see each other’s work.
Create Separate Schemas: In your database, create two separate schemas, one for each developer:
CREATE SCHEMA schema_name;
.Assign Permissions: After creating the schemas, you need to set up permissions to ensure that each developer has access only to their respective schema. For example, you can use
GRANT ALL PRIVILEGES ON SCHEMA schema_name TO user_name;
to give a developer full access to their schema while restricting access to the other developer’s schema.For more information on how to manage users and their permissions, I could suggest this documentaiton here:
An alternative approach is to have separate databases on a single database cluster as well.
Hope that this helps!
Best,
Bobby