In addition, it is highly available with an additional replica, and is enabled for zero-downtime migrations with safe migrations. The main branch now contains the categories and products tables you created, along with the data you inserted. Toggle " Enable safe migrations", then click the " Enable safe migrations" button. To enable safe migrations:Ĭlick "Overview" in the navigation, and click the " cog" in the upper right of the infrastructure card to open a modal. Instead, changes must be made using the PlanetScale flow, where deploy requests are used to safely merge changes in a collaborative environment. With safe migrations enabled, any DDL issued directly to the branch will not be accepted. Safe migrations is an optional, but highly recommended, feature that adds an additional layer of protection to your branch by preventing accidental schema modifications and enabling no-downtime schema changes. It also has the option to enable safe migrations, which enables non-blocking schema changes and can protect your database from accidental schema changes. Enable safe migrations on your main branchĪll of the work you've done so far has been on a default production branch, main, that was automatically created when you created the database.Ī production branch is a highly available database branch that includes an additional replica. If you click on the " Schema" tab in the database navigation and click the " Refresh schema" button, you'll see the new database schema. Click "Connect".Ĭreate the categories and products tables by running the following commands in the web console: This will open up a web console connected to your database branch.īy default the main branch is preselected. From your database's overview page, click on the " Settings" tab, check the box labelled " Allow web console access to production branches", and click " Save database settings".Ĭlick on the " Console" tab in the database navigation. This quickstart demonstrates how to create and use two relational tables: categories and products.īy default, web console access to production branches is disabled to prevent accidental deletion. While this is just the first branch we create for you, you can always create new development branches (isolated copies of the production schema) off of production to use for development. Your database is created with a default production branch, main, which you will use to apply a schema change and insert data. Finally, click the " Create database" button to deploy your database.If you are creating a database on the Hobby plan, you will not be charged. Select the desired plan type for your database.For the lowest latency, select a region near you or your application's hosting location. Click " New database" > " Create a database" on your organization's overview page.You'll need a PlanetScale account to complete this guide. This guide is split up so that you can either follow it in the PlanetScale dashboard or using the PlanetScale CLI. If you already have your PlanetScale database set up, you may find the Connecting your application or Branching guides more helpful. Promote your database branch to production.The following guide will show you how to:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |