@earth-app/collegedb
    Preparing search index...

    Function createSchema

    • Creates the database schema in the specified shard

      Parameters

      • db: SQLDatabase

        The database instance to create schema in

      • schema: string

        The SQL schema definition to execute

      Returns Promise<void>

      Promise that resolves when schema creation is complete

      If schema creation fails

      const userSchema = `
      CREATE TABLE users (
      id TEXT PRIMARY KEY,
      name TEXT NOT NULL,
      email TEXT UNIQUE
      );
      `;
      await createSchema(env.DB_NEW_SHARD, userSchema);