From the course: JavaScript: Client-Side Data Storage

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Defining index and schema

Defining index and schema - JavaScript Tutorial

From the course: JavaScript: Client-Side Data Storage

Start my 1-month free trial

Defining index and schema

- [Instructor] Now we have a database ready, but we need to define the index and primary keys and also set up the schema. Let's go ahead and do this. So before I forget, let's go ahead in at the styles to the index. So let's go in the meta here and just before the title, I'm gonna add a link, and this link will be the style sheet, styles.css. Perfect, save that. Let's go back to our browser to make sure everything is applied. Looking good. And while we're here, let's also add the title. Javascript Sandbox. So it looks nice, as well. Perfect, so we got our sandbox, we got our contact form here, and once we start adding some stuff, we'll have some contacts appear at the bottom here. All right, let's go back and define our schema. So let's go back to the app.js file here. So what we'll do in this file right after the request on success, we'll add a new request and we'll call this one onupgradeneeded. So basically this function or this method basically runs only once. So whatever is…

Contents