0% found this document useful (0 votes)
75 views52 pages

Build APIs You Won T Hate 1st Edition Phil Sturgeon Download

Build APIs You Won't Hate by Phil Sturgeon is a comprehensive guide published in 2015 that teaches readers how to effectively create APIs. The book covers various topics including database seeding, endpoint planning, input and output theory, error handling, and data relationships. It is available for digital download and aims to empower developers with practical knowledge and skills for API development.

Uploaded by

ugwvzkth942
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
75 views52 pages

Build APIs You Won T Hate 1st Edition Phil Sturgeon Download

Build APIs You Won't Hate by Phil Sturgeon is a comprehensive guide published in 2015 that teaches readers how to effectively create APIs. The book covers various topics including database seeding, endpoint planning, input and output theory, error handling, and data relationships. It is available for digital download and aims to empower developers with practical knowledge and skills for API development.

Uploaded by

ugwvzkth942
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 52

Build APIs You Won t Hate 1st Edition Phil Sturgeon

- Downloadable PDF 2025

https://ebookfinal.com/download/build-apis-you-won-t-hate-1st-edition-
phil-sturgeon/

Visit ebookfinal.com today to download the complete set of


ebooks or textbooks
Here are some recommended products that we believe you will be
interested in. You can click the link to download.

One Piece Vol 8 I Won t Die 1st Edition Oda

https://ebookfinal.com/download/one-piece-vol-8-i-won-t-die-1st-
edition-oda/

Career Wisdom for College Students Insights You Won t Get


in Class on the Internet or from Your Parents 1st Edition
Peter Vogt
https://ebookfinal.com/download/career-wisdom-for-college-students-
insights-you-won-t-get-in-class-on-the-internet-or-from-your-
parents-1st-edition-peter-vogt/

There Is Nothing Wrong with You Going Beyond Self Hate 2nd
Edition Cheri Huber

https://ebookfinal.com/download/there-is-nothing-wrong-with-you-going-
beyond-self-hate-2nd-edition-cheri-huber/

Christmas Gifts That Won t Break An Advent Study for Youth


1st Edition James W. Moore

https://ebookfinal.com/download/christmas-gifts-that-won-t-break-an-
advent-study-for-youth-1st-edition-james-w-moore/
The Great Lake Sturgeon 1st Edition Nancy Auer

https://ebookfinal.com/download/the-great-lake-sturgeon-1st-edition-
nancy-auer/

Can t Play Won t Play Simply Sizzling Ideas to Get the


Ball Rolling for Children With Dyspraxia 1st Edition
Sharon Drew
https://ebookfinal.com/download/can-t-play-won-t-play-simply-sizzling-
ideas-to-get-the-ball-rolling-for-children-with-dyspraxia-1st-edition-
sharon-drew/

Irresistible APIs Designing web APIs that developers will


love First Edition Kirsten Hunter

https://ebookfinal.com/download/irresistible-apis-designing-web-apis-
that-developers-will-love-first-edition-kirsten-hunter/

Amazing Leonardo da Vinci Inventions You Can Build


Yourself Maxine Anderson

https://ebookfinal.com/download/amazing-leonardo-da-vinci-inventions-
you-can-build-yourself-maxine-anderson/

Getting Started with Paint NET 1st Edition Andros Sturgeon

https://ebookfinal.com/download/getting-started-with-paint-net-1st-
edition-andros-sturgeon/
Build APIs You Won t Hate 1st Edition Phil Sturgeon
Digital Instant Download
Author(s): Phil Sturgeon
ISBN(s): 9780692232699, 0692232699
Edition: 1
File Details: PDF, 3.10 MB
Year: 2015
Language: english
Build APIs You Won’t Hate
Everyone and their dog wants an API, so you should probably learn
how to build them.

Phil Sturgeon
This book is for sale at http://leanpub.com/build-apis-you-wont-hate

This version was published on 2015-08-12

This is a Leanpub book. Leanpub empowers authors and publishers with


the Lean Publishing process. Lean Publishing is the act of publishing an
in-progress ebook using lightweight tools and many iterations to get
reader feedback, pivot until you have the right book and build traction
once you do.

©2013 - 2015 Phil Sturgeon


Tweet This Book!
Please help Phil Sturgeon by spreading the word about this book on
Twitter!
The suggested tweet for this book is:
I just bought @philsturgeon’s book about APIs, because he said if I didn’t
he would hurt me: http://apisyouwonthate.com
The suggested hashtag for this book is #apisyouwonthate.
Find out what other people are saying about the book by clicking on this
link to search for this hashtag on Twitter:
https://twitter.com/search?q=#apisyouwonthate
A huge thank you to all the developers and other folks who built the
technologies this book talks about.
I would also like to thank everyone who bought an early copy of this book on
LeanPub. 2014 was a really messed up year for me, and those book sales kept
me going, and kept me motivated to finish the book on time.
Without you, I would be much further away from getting my boat.
Contents

Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . i

Sample Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ii

1. Useful Database Seeding . . . . . . . . . . . . . . . . . . . . . . . . 1


1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Introduction to Database Seeding . . . . . . . . . . . . . . . . 1
1.3 Building Seeders . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.4 That is about it . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.5 Secondary Data . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.6 When to run this? . . . . . . . . . . . . . . . . . . . . . . . . . 11

2. Planning and Creating Endpoints . . . . . . . . . . . . . . . . . . . 12


2.1 Functional Requirements . . . . . . . . . . . . . . . . . . . . . 12
2.2 Endpoint Theory . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.3 Planning Endpoints . . . . . . . . . . . . . . . . . . . . . . . . 21

3. Input and Output Theory . . . . . . . . . . . . . . . . . . . . . . . . 24


3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
3.2 Requests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
3.3 Responses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
3.4 Supporting Formats . . . . . . . . . . . . . . . . . . . . . . . . 27
3.5 Content Structure . . . . . . . . . . . . . . . . . . . . . . . . . 32

4. Status Codes, Errors and Messages . . . . . . . . . . . . . . . . . . 38


4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
4.2 HTTP Status Codes . . . . . . . . . . . . . . . . . . . . . . . . . 38
4.3 Error Codes and Error Messages . . . . . . . . . . . . . . . . . 40
4.4 Error or Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
4.5 Standards for Error Responses . . . . . . . . . . . . . . . . . . 43
CONTENTS

4.6 Common Pitfalls . . . . . . . . . . . . . . . . . . . . . . . . . . 45

5. Endpoint Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
5.2 Concepts & Tools . . . . . . . . . . . . . . . . . . . . . . . . . . 47
5.3 Setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
5.4 Initialise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
5.5 Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
5.6 Scenarios . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
5.7 Prepping Behat . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
5.8 Running Behat . . . . . . . . . . . . . . . . . . . . . . . . . . . 53

6. Outputting Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
6.2 The Direct Approach . . . . . . . . . . . . . . . . . . . . . . . . 56
6.3 Transformations with Fractal . . . . . . . . . . . . . . . . . . . 60
6.4 Hiding Schema Updates . . . . . . . . . . . . . . . . . . . . . . 66
6.5 Outputting Errors . . . . . . . . . . . . . . . . . . . . . . . . . . 66
6.6 Testing this Output . . . . . . . . . . . . . . . . . . . . . . . . . 70
6.7 Homework . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72

7. Data Relationships . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
7.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
7.2 Subresources . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
7.3 Foreign Key Arrays . . . . . . . . . . . . . . . . . . . . . . . . . 75
7.4 Compound Documents (aka Sideloading) . . . . . . . . . . . . 76
7.5 Embedded Documents (aka Nesting) . . . . . . . . . . . . . . . 77
7.6 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84

8. Debugging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
8.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
8.2 Command-line Debugging . . . . . . . . . . . . . . . . . . . . 85
8.3 Browser Debugging . . . . . . . . . . . . . . . . . . . . . . . . . 86
8.4 Network Debugging . . . . . . . . . . . . . . . . . . . . . . . . 91

9. Authentication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
9.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
9.2 When is Authentication Useful? . . . . . . . . . . . . . . . . . 96
9.3 Different Approaches to Authentication . . . . . . . . . . . . . 97
CONTENTS

9.4 Implementing an OAuth 2.0 Server . . . . . . . . . . . . . . . 107


9.5 Where the OAuth 2.0 Server Lives . . . . . . . . . . . . . . . . 108
9.6 Understanding OAuth 2.0 Grant Types . . . . . . . . . . . . . . 109

10.Pagination . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
10.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
10.2 Paginators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
10.3 Offsets and Cursors . . . . . . . . . . . . . . . . . . . . . . . . 119

11.Documentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
11.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
11.2 Types of Documentation . . . . . . . . . . . . . . . . . . . . . . 124
11.3 Picking a Tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
11.4 Setting up API Blueprint and Aglio . . . . . . . . . . . . . . . . 127
11.5 Learning API Blueprint Syntax . . . . . . . . . . . . . . . . . . 129
11.6 Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . . 139

12.HATEOAS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
12.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
12.2 Content Negotiation . . . . . . . . . . . . . . . . . . . . . . . . 140
12.3 Hypermedia Controls . . . . . . . . . . . . . . . . . . . . . . . 144

13.API Versioning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153


13.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
13.2 Different Approaches to API Versioning . . . . . . . . . . . . . 154
13.3 Ask Your Users . . . . . . . . . . . . . . . . . . . . . . . . . . . 168

Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169

Further Reading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171


API Web Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
Non-API Books . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
Introduction
A lot of articles and tutorials talk about REST and with a varying level of
accuracy. Some claim that certain things are more RESTful than others
whilst actually having very little to do with REST. The word REST has been
so utterly misused for the last seven or eight years that it actually means
nothing anymore, and a large chunk of the API development community
has moved to terms like Hypermedia API to represent what was intended
by the original meaning of REST before it was utterly ruined. This book
will not get too hung up on these politics. It will mostly outline the pros
and cons of various approaches, only giving you the “one true way” when
the other approaches are all patently awful (like SOAP and XML-RPC).
Whilst trying to learn about API development, I found most resources out
there to be horribly lacking or specifically aimed at one single framework.
Many tutorials and books use apples and pears examples that are not con-
crete enough, or talk like listing /users and /users/1 are the only endpoints
you will ever need. Between 2012 and 2014, I worked for a company called
Kapture where my primary function was to inherit, rebuild, maintain and
further develop a fairly large API with many different endpoints exposing
a lot of different use cases.
This book will discuss the theory of designing and building APIs in any
language or framework. This theory will be applied in examples built
mostly in PHP, with some Ruby and Python too. The book will not be too
code-heavy regardless, since reading code is no fun.
By the end of this book, you will have built an API that can create, read,
update, delete things, handle searching, and do everything else a good
Hypermedia API needs to do.

i
Sample Code
This book covers both theory which is applicable to any language, and
it covers concrete examples using source code written in PHP. PHP was
selected mostly because it had to be written in something, but all content
is applicable to any language.
The code can be downloaded in a few ways.
a) You can clone it:

1 $ git clone https://github.com/philsturgeon/build-apis-you-wont-hate.git

b) Browse around it:

https://github.com/philsturgeon/build-apis-you-wont-hate

c) Download it as a .zip file:

http://bit.ly/apisyouwonthate-zip

The book assumes a few things in relation to this same code.

1. You have PHP 5.4 available.


2. You are ok playing with Laravel 4, even if you have no experience with
it.
3. You place the contents in ∼/apisyouwonthate.

If you put the sample code somewhere else, then update the path in the
examples.

ii
1. Useful Database Seeding
1.1 Introduction

The first step to creating any sort of application is creating the database.
Whether you are using some sort of relational platform, MongoDB, Riak,
or whatever, you will need a vague idea of how your data is going to be
stored.
For relational databases it is very likely you will start off your planning
with an entity-relationship diagram. For document based databases such
as MongoDB, CouchDB or ElasticSearch, you will just let your application
magically build a schema. Either way, you need to create a plan - even if it
is on a napkin. This book will assume a traditional relational database is
storing your data, but the principles are easily adapted for NoSQL systems
too.
This chapter assumes you have already got a database designed and built.
This chapter skips the “planning a database” section, because there are
plenty of other books on that already.

1.2 Introduction to Database Seeding

With a database schema designed and implemented, the next step is


to store some data. Instead of entering your real data, it is far easier
to use “dummy data” to test if the schema is appropriate for your API
application. This brings the added benefit of letting you ditch the database
and try again without worrying about maintaining the data.
The process of populating a database is known as “seeding”.
This data could be:

• test users
• content entries with a bunch of comments

1
Useful Database Seeding 2

• fake locations available for check-in


• fake notifications to display in an iPhone app (one of each type)
• credit-card payments at various stages of processing - with some
complete, some half done and some super-fraudulent looking ones

The process of creating seeding scripts means you can avoid wasting
time creating them manually over and over again. Ultimately, the more
processes you can automate during the development of your API, the more
time you have to consider the intricacies of your applications, which need
much more consideration.
Dummy data is necessary for realistic acceptance testing, getting free-
lancers/new hires up to speed with useful content, keeping real customer
data private to those outside your company, and avoiding the temptation
to copy live data over to your development environments.

Why is using production data in development bad?

Have you ever been writing a script that sends out emails and used some
dummy copy while you’re building it? Ever used some cheeky words
in that content? Ever accidentally sent that email out to 10,000 real
customers email addresses? Ever been fired for losing a company over
£200,000?
I haven’t, but I know a guy that has been. Don’t be that guy.

What data should you use?

Garbage! Use absolute nonsense for your development database, but non-
sense of the correct data type, size, and format. That can be done with a
fun little library called Faker1 by François Zaninotto2 which is a wonderful
little library that can essentially bullshit for Queen and country.
1
https://github.com/fzaninotto/Faker
2
https://twitter.com/francoisz/
Useful Database Seeding 3

1.3 Building Seeders

Kapture, the company I previously worked for, used the Laravel frame-
work, which has Database Seeding3 baked in. This is essentially a tarted
up CLI task, which almost any modern PHP framework will have (or bloody
well should), so the principles are applicable to all.
Break your database seeders down into logical groupings. This does not
need to be “one seeder-per-table”, but it can be. Sometimes your data
needs to be built at the same time as other types of data. For example,
users are created in the same seeder as their settings, OAuth tokens, and
friendship data is made. Putting that into multiple seeders purely to keep
things tidy would complicate your seeders and slow things down a lot, so
maybe consider combining them.
In this chapter I will use a check-in application as an example. The appli-
cation handles “users” and tracks their “check-ins” into “merchants”
(or “venues”). “Merchants” also provide “campaigns” (or “opportuni-
ties”).
So, this is a simplified version of the user seeder, ignoring the Laravel-
specific structure. If you are using Laravel, just shove this in your run() method.

Creating a user with Faker and Eloquent ORM

1 $faker = Faker\Factory::create();
2
3 for ($i = 0; $i < Config::get('seeding.users'); $i++) {
4
5 $user = User::create([
6 'name' => $faker->name,
7 'email' => $faker->email,
8 'active' => $i === 0 ? true : $faker->boolean,
9 'gender' => $faker->randomElement(['male', 'female', 'other']),
10 'timezone' => $faker->numberBetween(-10, 10),
11 'birthday' => $faker->dateTimeBetween('-40 years', '-18 years'),
12 'location' => $faker->boolean ? "{$faker->city}, {$faker->state}" : null,
13 'had_feedback_email' => $faker->boolean,
14 'sync_name_bio' => $faker->boolean,
15 'bio' => $faker->sentence(100),
3
http://laravel.com/docs/migrations#database-seeding
Useful Database Seeding 4

16 ]);
17 }

What do we have here? Let’s go through this one section at a time:

1 $faker = Faker\Factory::create();

An instance of Faker, our bullshit artist for-hire.

3 for ($i = 0; $i < Config::get('seeding.users'); $i++) {

We are going to want a certain number of users, but you should have a few
less on development than you do on testing or staging to save time.

5 $user = User::create([
6 'name' => $faker->name,
7 'email' => $faker->email,

Make a random name and random email. There is no need to define the
pool of random data it uses, because IT’S MAGIC!

8 'active' => $i === 0 ? true : $faker->boolean,

Ok I lied, our garbage is not 100% random. We want user number 1 to be


active for tests later on.

9 'gender' => $faker->randomElement(['male', 'female', 'other']),

Gender equality is important.

10 'timezone' => $faker->numberBetween(-10, 10),


Useful Database Seeding 5

Our original developer decided that saving time zones as an integer was a
clever thing to do.

Store Time zones, Not Offsets


Did you know that some time zones are not complete hours?
Did you know that Nepal is UTC/GMT +05:45? Did you know that
Chatham Island (New Zealand) goes from UTC/GMT +12:45 to
UTC/GMT +13:45 in their local summer? Did you know that some
places add 30 minutes when in daylight savings time? Don’t use
integers as timestamps. Most major programming languages
(PHP included) implement the IANA4 time zone database,
which is an industry standard. If you store America/New_York or
Asia/Khandyga then the offset and daylight savings time can be
automatically calculated.

11 'birthday' => $faker->dateTimeBetween('-40 years', '-18 years'),

Users of all of our target age demographic.

13 'location' => $faker->boolean ? "{$faker->city}, {$faker->state}" : null,

Give us a city name and a state name. This works fine with loads of
countries, which is cool.

14 'had_feedback_email' => $faker->boolean,


15 'sync_name_bio' => $faker->boolean,

Some user flags are not as important, so set them to be true or false at
random.

16 'bio' => $faker->sentence(100),

Make a sentence with 100 characters in it.


4
http://www.iana.org/time-zones
Useful Database Seeding 6

1.4 That is about it

You will end up making a lot of these files, and you will want to populate
pretty much every table you have with data. You will also want to tell
your Database Seeder to wipe all the tables that will be populated. Do this
globally right at the start of the process. Do not wipe tables at the top of
each seeder, or content in that table from other seeders will be deleted.

Example of an overall system in Laravel

1 class DatabaseSeeder extends Seeder


2 {
3 public function run()
4 {
5 if (App::environment() === 'production') {
6 exit('I just stopped you getting fired. Love Phil');
7 }
8
9 // Disable mass-assignment protection with Laravel
10 Eloquent::unguard();
11
12 $tables = [
13 'locations',
14 'merchants',
15 'opps',
16 'opps_locations',
17 'moments',
18 'rewards',
19 'users',
20 'oauth_sessions',
21 'notifications',
22 'favorites',
23 'settings',
24 'friendships',
25 'impressions',
26 ];
27
28 foreach ($tables as $table) {
29 DB::table($table)->truncate();
30 }
31
32 $this->call('MerchantTableSeeder');
Useful Database Seeding 7

33 $this->call('PlaceTableSeeder');
34 $this->call('UserTableSeeder');
35 $this->call('OppTableSeeder');
36 $this->call('MomentTableSeeder');
37 }
38 }

This wipes everything, then runs other seeder classes to do their thing.

Foreign Keys
It can be difficult to wipe a database when foreign keys con-
straints are enforced, so in that scenario your seeder should
run DB::statement('SET FOREIGN_KEY_CHECKS=0;'); before the
truncation of the tables and DB::statement('SET FOREIGN_KEY_-
CHECKS=1;'); afterwards to enable the checks again.

1.5 Secondary Data

As I said, it is quite likely that you will need to insert data that relates
to itself. To do this, work out which data will be primary (like users). In
the case of a check-in system you will also probably consider “venues” or
“merchants”, depending on the nomenclature of your system.
For this example, I will show how to create “merchants”, then attach
“opportunities”, which are essentially “campaigns”.

Primary Seeder for the Merchant Table

1 <?php
2
3 class MerchantTableSeeder extends Seeder
4 {
5 /**
6 * Run the database seeds.
7 *
8 * @return void
9 */
10 public function run()
Useful Database Seeding 8

11 {
12 $faker = Faker\Factory::create();
13
14 // Create however many merchants
15 for ($i = 0; $i < Config::get('seeding.merchants'); $i++) {
16 Merchant::create([
17 'name' => $faker->company,
18 'website' => $faker->url,
19 'phone' => $faker->phoneNumber,
20 'description' => $faker->text(200),
21 ]);
22 }
23 }
24 }

Primary Seeder for the Opp Table

1 <?php
2
3 use Carbon\Carbon;
4 use Kapture\CategoryFinder;
5
6 class OppTableSeeder extends Seeder
7 {
8 protected $categoryFinder;
9 protected $places;
10
11 public function __construct(CategoryFinder $finder, Place $places)
12 {
13 $this->categoryFinder = $finder;
14 $this->places = $places;
15 }
16
17 protected $imageArray = [
18 'http://example.com/images/example1.jpg',
19 'http://example.com/images/example2.jpg',
20 'http://example.com/images/example3.jpg',
21 'http://example.com/images/example4.jpg',
22 'http://example.com/images/example5.jpg',
23 ];
24
25 public function run()
Useful Database Seeding 9

26 {
27 $faker = Faker\Factory::create();
28
29 foreach (Merchant::all() as $merchant) {
30
31 // Create however many opps for this merchant
32 foreach (range(1, rand(2, 4)) as $i) {
33
34 // There are three types of image to add
35 $image = Image::create([
36 'name' => "{$merchant->name} Image #{$i}",
37 'url' => $faker->randomElement($this->imageArray),
38 ]);
39
40 // Start it immediately and make it last for 2 months
41 $starts = Carbon::now();
42
43 // We need to definitely have at least one we are in control of
44 if ($i === 1) {
45 // Have ONE that ends really soon
46 $ends = Carbon::now()->addDays(2);
47 $teaser = 'Something about cheese';
48
49 } else {
50 $ends = Carbon::now()->addDays(60);
51 $teaser = $faker->sentence(rand(3, 5));
52 }
53
54 $category = $this->categoryFinder->setRandom()->getOne();
55
56 $opp = Opp::create([
57 'name' => $faker->sentence(rand(3, 5)),
58 'teaser' => $teaser,
59 'details' => $faker->paragraph(3),
60 'starts' => $starts->format('Y-m-d H:i:s'),
61 'ends' => $ends->format('Y-m-d H:i:s'),
62 'category_id' => $category->id,
63 'merchant_id' => $merchant->id,
64 'published' => true,
65 ]);
66
67 // Attach an image to the opp
68 $opp->images()->attach($image, [
Useful Database Seeding 10

69 'published' => true


70 ]);
71 }
72
73 echo "Created $i Opps for $merchant->name \n";
74 }
75 }
76 }

This might look a little crazy, and it is certainly a mixture of lazy-static


ORM usage in the controller and some dependency injection, but these
seeders have not received a large amount of love. They definitely do their
job, and could always be cleaner, but here are the basics:

41 foreach (Merchant::all() as $merchant) {

Loop through all merchants.

43 // Create however many opps for this merchant


44 foreach (range(1, rand(2, 4)) as $i) {

Create between 1 and 4 opportunities for a merchant.

46 // There are three types of image to add


47 $image = Image::create([
48 'name' => "{$merchant->name} Image #{$i}",
49 'url' => $faker->randomElement($this->imageArray),
50 ]);

Add an image from our array of example images on S3, or our website
somewhere. The more the merrier.

66 $category = $this->categoryFinder->setRandom()->getOne();

I will talk more about finders in a later chapter, but for now, just know this
is a convenient way of getting a single random category back.
The rest should all be relatively obvious.
If you are using Laravel, you can run the above commands on the com-
mand line with: $ php artisan db:seed. The Rails equivalent is hilariously
similar: $ rake db:seed.
Useful Database Seeding 11

1.6 When to run this?

Database seeds are often run both manually and automatically, depending
on what is going on.
For example, if you have just added a new endpoint with new data, you
will want to let your teammates know to pull the latest code, run the
migrations and run the seed.
This is also great when a freelancer comes in to do some work, or a new
developer starts up, or your iPhone dev wants to get some data to use. In
all these instances, that command just needs to be run on the command
line.
This is also occasionally run manually on the staging server and automat-
ically on the Jenkins testing server when we deploy new builds of the API.
Another Random Scribd Document
with Unrelated Content
2 3 4 5 6 7 8 9 10 11 (4) 12 (5) 13 14 15 16
GENEALOGICAL REGISTER. 805 Jabez Marble, b. in Stow Sept. 15,
1755, md. Nov. 29, 1780, Mary Salter, dau. of Samuel Salter, q. v.,
and settled in Stow where he lived until 1789, when he removed to
this town. He lived on the farm formerly occupied by Samuel Salter,
and now by Warren Marble. He d. Dec. 23, 1843 ; she d. Dec. 22,
1845. I. Hannah, b. ; d. Sept. 21, 1792. II. Eunice, b. April 28, 1783
; md. George Wilker, Jr., q. V. III. Jabez, b. April 29, 1785.+ IV.
Stephen, b. Nov. 8, 1787. + V. Phebe, b. Feb. 1, 1790 ; md. John
Carter of Fitchburg. VI. Lydia, b. Feb. 8, 1792; md. John Russell of
Townsend. VII. Lois (twin), b. Feb. 8, 1792 ; md. April 21, 1812,
Joseph Smith of Leominster. VIII. Joel, b. Feb. 1, 1794.+ IX. Grata,
b. May 4, 1797 ; md. April 7, 1822, Joseph Wheeler ; resided in
Acton. X. Asenath, b. Oct. 25, 1801 ; md. 1821, David Flint, b. March
27, 1793, son of Edmund and Abigail (Damon) Flint of Ashby. He d.
Sept. 5, 1870; shed. Aug. 22, 1867. Jabez Marble, Jr., md. 1815,
Anna Dutton, b. Nov. 9, 1788, dau. of Samuel and Rhoda Dutton of
Ashby. He was a farmer. He d. in this town July 8, 1826. I. Son^ b. ;
d. young. Stephen Marble ind. Nov. 12, 1816, Polly Flint, b. Oct. 27,
1790, dau. of Edmund and Abigail (Damon) Flint of Ashby. He was a
farmer on Russell hill ; removed to Ashby 1850, where he d. Aug.
19, 1855; she d. March 2, 1855. I. Albert Proctor, b. Aug. 9, 1817 ;
d. unmd. II. Elmira, b. June 26, 1820 ; md. Joseph Gushing, q. V.
III. Edmund Newton, b. Dec. 4, 1822 ; md. April 23, 1848, Dolly
Billings, dau. of Joshua Billings, Jr., q. V. He d. Aug. 19, 1885 ; she
resides in Fitchburg. IV. Stephen Jackson, b. Nov. 3, ]'Si>8; md.
1850, Lydia A. Maynard, dau. of Horace Maynard, q. V. She d. . He
resides in Fitchburg.
806 HISTORY OF ASHBURNHAM. (9) 17 18 19 20 21 (17)
22 23 24 25 26 (18) 27 28 29 30 Joel Marpjle md. Nov. 19, 1818,
Susan Sawin, dau. of Asa Sawin, q. v. ; she d. June 22, 1823 ; he
md. (2d) 1823, Mary Winship of Westminster. He was a farmer and
at different times occupied the farms now of Warren Marble and of
Hosea Green. He d. March 10, 1869 ; hi& wife d. Oct. 12, 1859. I.
Luke, b. April 30, 1820. + II. Newell, b. Jan. 29, 1822.+ III. Infcmt,
b. and d. June, 1823. IV. Susan, b. Sept. 19, 1824; d. Dec. 20, 1838.
V. TFotrren, b. Aug. 1, 1826. -jLuKE Marble md. April 24, 1845,
Abigail Moore, dau. of Pitt Moore, q. v., and now resides in Central
Village. Until recently he lived in the northeast part of the town,
where he was successfully engaged in farming and in the
manufacture of lumber. He has been assessor and elected to other
office in town affairs. II. III. IV. V. Jonas P., b. April 3, 1846 ; d. Sept.
14, 1848. Joel P., b. June 11, 1848. He is a merchant in the firm of
Marble nnd Gilson. He md. June 11, 1871, Caroline Holmes. Alden
B., b. Aug. 11, 1851; md. Feb. 1, 1873, Flora A. Jaquith. He is a
successful farmer on the old Kibling farm, frequently called the
Caldwell farm. Warren E., b. Oct. 7, 1855; md June 15, 1882, Nellie
M. Fuller. He is a farmer and proprietor of the Marble Mills. Mary
E.,h. April 24,1857; md. Feb. 5, 1881, Frank W. Davis of Ashby. He
resides in Ashburnham. Newell Marble md. April 29, 1845, Emma J.
Wilker, dau. of Jacob Wilker, g. v. He was a farmer and a morocco
finisher and lived near the school-house in the third district. He d.
Aug. 12, 1885. I. George Francis, h. July 16, 1846; md. Oct. 1, 1871,
Hannah B. Boston of Barrington, N. H. ; resides at Great Falls, N. H.
Franliin Augustus, b. March 17, 1848 ; d. June 28, 1848. II. III. IV.
Ella Augusta, b. Feb. 10, 1850 ; d. Aug. 28, 1852. Celia Viola, b.
Aug. 25, 1853 ; md. Feb. 7, 1877, Elwyn D. Gibson, son of Jerome S.
Gibson, g. v.
GENEALOGICAL REGISTER. 807 31 V. Charles Sumner, b.
Nov. 1, 1855; md. Jan. 27, 1877, Lillian A. Gibson, dau. of Jerome S.
Gibson, q. v. 32 Yi. Lyra Madora, b. Aug. 4, 1858 ; d. March 11,
1865. 33 VII. Roseita Emogene, b. March 3, 1862. 34 VIII. Fernando
U'hjsses, h. 'Soy. 7, 1865; d. June 4, 1876. 35 IX. Lilla Malora, b.
Oct. 18, 1867. 36 X. Melvin Newell, b. Sept. 7, 1869 ; d. May 29,
1876. 45 46 47 48 50 51 52 53 (21) Warren Marble is a farmer on
the homestead. He md. May 22, 1851, Mary L. Wilker, dau. of Jacob
Wilker, g. v. 37 I. Emma A., b. March 16, 1852 ; md. Sept. 4, 1870,
Herbert W. Whitney, son of Otis Whitney, q. V. 38 II. Frank i., b. Aug.
1, 1854; md. April 30, 1876, Sarah A. Nichols, dau. of John Nichols,
q. v. 39 III. Walter H., b. Sept. 13, 1858 ; a physician. Vide page
509. 40 IV. Susie E., b. Dec. 1, 1861 41 V. Lizzie X., b. Jan. 7, 1865.
42 VI. BertonH., b. July 11, 1867 ; d. Aug. 8, 1870. 43 VII. Harlan
B., b. Dec. 10, 1871 ; d. July 22, 1877. 44 Oliver Marble, twin
brother of Jabez Marble, md. Deborah Bailey, and with five children
removed to this town in 1789. He settled on the Emory Fairbanks
farm now of Charles Kelton. He d. while visiting a son in Lyndeboro',
N. H., July 29, 1827. His widow d. in this town Aug. 28, 1833, aged
70. I. Oliver, b. Aug. 8, 1781.+ II. Rlioda. b. Oct. 10, 1783 ; md.
Nathan Taylor, g. v. III. Deborah, b. Aug. 6, 1785; md. Dec. 12,
1805, Asa Eaton, b. Nov. 29, 1785, son of Benjamin and Lydia Eaton
of Ashby. They removed to Sprino;field, Vt. IV. Bailey, b. Aug. 3,
178- ; removed to western New York ; md. Penelope Hall. V. Lois, b.
Sept. 20, 1791 ; md. John Hall, g. v. VI. Tamar, b. July 2, 1789 ; d.
Oct. 27, 1794. VII. Samuel, b. July 8, 1793.+ VIII. Hannah, b. Nov.
10, 1795; md. Joel Barrett, g. V. ; md. (2d) Joseph Miller, g. v. IX.
Abner, b. Oct. 29, 1798; resided in Lyndeboro', N. H.
808 HISTORY OF ASHBURNHAM. 54 (45) 55 56 57 58 59
60 61 62 63 64 65 66 (51) X. Tamai\ b. June 23, 1803 ; mcl. Sept.
27, 1832, Benjamin C. Pillsbury ; they reside in Ashby. Three or more
children. Oliver Marble md. April 7, 1805, Dolly Green, dau. of Oliver
Green, q. v. He resided in this town many years and subsequently in
New Ipswich, where he d. in 1851 ; his widow d. Nov. 12, 1859. I.
Alma (r., b. March 29, 1806 ; md, John Leathers, q. V. II. Betsey, b. ;
d. March 16, 1808. III. Lewis^ b. May 7, 1809 ; md. Dec. 11, 1842,
Louisa Adams; he was a millwright; d. in this town Oct. 25, 1844. 1.
Lewis, b. 1844. IV. Heman L.^ b. April 7, 1811 ; a carriage maker in
Springfield, Vt. ; md. Eliza Smallev. V. AsaheUh. Feb. 1, 1814; md.
Sept. 8, 1842, Betsey Walton, b. Aug. 10, 1814, dau. of Nathan
Walton of Rindge ; he was a mechanic ; resided in New Ipswich,
Rindge, and after 1850 in Ashburnham, where he d. Jan. 15, 1871.
1. Henry A., b. Aug. 29, 1843; enlisted in 53d Regiment ; d. at New
Orleans May 19, 1863. 2. Nathan E., b. Jan. 6, 1848; d. unmd.
March 13, 1879. 3. William A., b. Sept. 18 1850; unmd.; resides in
Ashburuham. VI. Dorothy II., b. Nov. 11, 1816 ; md. Elliot Moore, q.
V. VII. Chester, b. March 19, 1820; md. Sarah Smalley ; resided at
Chicago, 111. VIII. i^awma, b. April 4, 1823 ; unmd.; resides at
Townsend. Samuel Marble resided in Lyndeboro' and in Milford, N.
H., and later in Jatfrey, N. H., where he d. April 10, 1883. He md.
May 21, 1816, Lucy Metcalf, dau. of Ezekiel S. Metcalf, q v. ; md.
(2d) Grata Carter, b. Dec. 26, 1804, dau. of Capt. Jonah Carter; md.
(3d) Olive Greenwood. There were six children of Samuel and Lucy
(Metcalf) Marble.
GENEALOGICAL REGISTER. 80» 67 I. Bailey, b. ; rad. Nov.
10, 1839, Nancy Ellis, dau. of Jesse Ellis, q. v. They resided in this
town and subsequently in Lowell, where she d. Jan. 31, 1854; he d.
1881. 68 1. Abbie Jane, b. Sept. 10, 1842. 69 2. MaryE., b. Sept. 13,
1846; d. Oct. 14, 1847. 70 3. Waldo B., b. April 3, 1851. 71 II.
Howard, b. July 23, 1820; md. April 6, 1847, Mary A. Crehore, dau.
of Col. Timothy Crehore, q. v. Thev reside in Fitchburg. 72 III.
Louisa, b. . 73 IV. Dustan, b. ; resides at Akron, Ohio. 74 V. Calvin,
b. ; resides at Cleveland, Ohio. 75 VI. Tila, b. ; d. unmd. at Jaffrev,
N. H., May 21, 1883. MAKTIN. John Martin, Jr., and wife Elizabeth,
removed from Ipswich to Lunenburg 1739. He d. about 1753,
leaving a widow and ten children. Of these, four at least became
associated with the people of Ashburnham : I. John, b. Oct. 12,
1740 (No. 1); II. Elizabeth, b. June 12, 1744, md. Job Colman, q. V.
; III. Susannah, b. April 1, 1751, md. Benjamin Colman, q. v. ; IV.
Prudence, b. May G, 1753, md. Amos Brooks, q. v. 1 John Martin,
son of John and Elizabeth Martin, b. Oct. 12, 1740, md. March 3,
1761, Betty Chaplin of Lunenburg. The}^ united with the church in
1764, and withdrew to join the Baptists in 1778. He was identified
with the settlement, but it is probable he lived over the line in
Fitchburg. Five children were baptized after the ordination of Mr.
Cushing. There is no record of baptisms during the ministry of Mr.
Winchester. I. Barzillai, bap. June 4, 1769. II. Betty, bap. Oct. 28,
1770. III. Molly ^ bap. Sept. 22, 1772. IV. Prudence, bap. Sept. 11,
1774. V. Sarah, bap. April 13, 1777. Lewis G. Matthews was b. in
Gardner May 13, 1817. He is a son of Joel and Sarah (Coolidge)
Matthews and a grandson of John and Patience (Graves) Matthews.
He was a merchant several years at the South Village, wliere he still
resides, unmd. Hezekiah Matthews, a brother of Lewis G., was b. in
Gardner Oct. 24,1818; md. June 9, 1851, Sally Gates,
810 HISTORY OF ASHBURNHAM. 2 3 4 5 6 7 8 9 10 For a
number of years he He resides at South Vildau. of William Gates, q.
v. was a manufacturer of chairs, lage. Two children. I. Edward L.^ b.
March 9, 1855 ; d. young. II. Josephine Isabel^ b. Nov. 4, 1860.
Sumner May was b. in Sterling July 18, 1799. He was a son of Levi
and Deborah (Wilder) May, grandson of Thomas and great-grandson
of John May. He resided in Westminster until the autumn of 1827,
when he removed to South Village. In 1856, in connection with his
son Charles, he built the mill occupied by Bernard Duane & Co. He
md. in Westminster, Nov. 15, 1821, Mira Eaton, b. Nov. 20, 1800,
dau. of Nathan Eaton; she d. May 4, 1861 ; md. (2d) Feb. 13, 1862,
Mrs. Philetta J. Johnson of Templeton. He d. Feb. 9, 1879. I.
Augustine, b. Oct. 14, 1822; md. 1846, Lorena Cram of Gardner. II.
Augustus (twiu),b. Oct. 14, 1822; md. Elizabeth Reed of Groton ; he
resides at South Village. III. Levi Wilder^ b. Feb. 2, 1825 ; resides in
Newfield, N. J. ; he md. 1846, Mary Bosworth of Winchendon. IV.
Charles Sumner^ b. April 10, 1827 ; unmd. ; resides at South
Village. V. Harriet Elvira, b. Feb. 2, 1829 ; md. J. B. Barrell, q. v. VI,
George Washington, b. Oct. 14, 1831 ; md. Jane Hoyt ; resides in
Templeton. VII. Sarah E., b. Feb. 13, 1834; d. unmd. July 4, 1858.
VIII. Orange Scott, b. Nov. 22, 1836 ; unmd. ; resides at South
Village. He is a postmaster at Ashburnham Depot. IX. Achsah Irene,
b. Jul}^ 5, 1839 ; md. April 14, 1861, Stephen C. Whitney of
W^estminster. He d. Feb. 20, 1863. Vide p. 455. She resides in
Templeton. MAYNARD. John Maynard, the emigrant ancestor of the
Maynard family of New England, was a resident of Sudbury. His
homestead was in the east part of the town and is now included
within the town of Wayland. He was md. in England, and came to
America in 1638. He shared in the division of Sudbury meadows
1639, and was one of the petitioners for the town of Marlboro',
where he settled his son, John. He was a selectman and held other
office in Sudbury. No record of his first marriage or the death of his
wife appears;
GENEALOGICAL REGISTER. 811 he md. (2d) 16-46, Mary
Axtell, by whom he had three daughters. He d. Dec. 1, 1672; his
widow was residing in Charlestown during the Indian troubles in
1675-6. John Maynard, son of John, was b, in England 1630, being
eight years of age when his father came to America. He md. April 5,
1658, Mary Gates, dau. of Stephen Gates of Lancaster and
Cambridge, and settled in Marlboro'. He was a selectman and was
prominently associated with the affairs of the settlement. He md.
(2d) Sarah Blanford Keyes, b. Jan. 27, 1642-3, widow of Elias Keyes
and dau. of John and Dorothy (Wright) Blanford of Sudbury. Eight
children by first and three by second marriage. He d. Dec. 22, 1711;
his widow was living in 1722. Da^id Maynard, son of John and Mary
(Gates) Maynard, b. Dec. 21, 1669, md. Hannah Wait, dau. of
Joseph and Ruhamah (Hager) Wait. He lived in the westerly part of
Marlboro', now Westboro', and, following in the footsteps of his
father and grandfather, he was much employed in town affairs and
was frequently chosen to office. His wife d. March 16, 1724-5; he
md. (2d) Feb. 6, 1732-3, Jemima Brigham. He d. Oct. 2, 1757. Of his
eleven children, the descendants of Nathan and Jotham have resided
in Ashburnham. Nathan Maynard, son of David, was b. in Westboro'
Jan. 2, 1722; md. Jan. 1, 1750-1, Lucy Pratt, according to town
records, but Lucy Whipple by tradition. He lived in Westboro', Avhere
he d. 1811; his wife d. May 18, 1773. Nehemiah Maynard, son of
Nathan, b. May 27, 1754, settled in this town and is No. 1 in the
following register. Jotham Maynard, son of David and Hannah (Wait)
Maynard, b. May 29, 1714, md. 1740, Abiah or Abigail Allen and
resided in Westboro' and Bolton. The eldest of their ten children was
Jotham Maynard, b. March 14, 1741; md. 1763, Dinah Powers. The
sixth of their seven children was Dea. Antipas Maynard, b. in Bolton
April 27, 1776; md. Aug. 14, 1797, Sally Rice, b. in Marlboro' Nov.
15, 1772, dau. of Eleazer and Elizabeth (Darling) Rice. They resided
in Sullivan, N. H., and in Keene, N. H., where he d. March 15, 1833;
she d. in Boston, Oct. 22, 1861. Of their children, Antipas Maynard,
b. in Sullivan, N. H., Dec. 31, 1801, is No. 23 in the following
register. Jotham Maynard, the grandfather of Antipas Maynard of
Ashburnham, was a first cousin of Nehemiah Maynard of
Ashburnham. 1 Nehemiah Maynard, the first of the name in
Ashburnham, was b. in Westboro' May 27, 1754. He was a son of
Nathan and Lucy (Pratt) Maynard. He md. Dorothy Maynard, b. in
Shrewsbury Oct. 3, 1748, dau. of Reuben and Dorothy (Williams)
Maynard. He settled in Ashburnham, on the farm now of Joel H.
Litch, in 1775 or the spring of 1776. He d. May 29, 1828. I. Eclioard,
b. June 4, 1776. -fII. Stephen, b. March 11, 1778. + Sally, b. April
21, 1780; md, Stephen Lawrence, b. May III Sept. 27, 1803, 28,
1780, son of Shed. Charles and Naomi Lawrence of Ashby. in Ashby
July 24, 1810 ; he md. (2d) Mehitable Coe. 1. 2. There were two
children by first marriage. Amy, b. Sept. 6, 1805. Charles, b. Jan. 20,
1808 ; d. Feb. 24, 1808. IV. Joseph, b. Oct. 24, 1782; md. Dec. 13,
1804, Sarah Miller, b. Jan. 3, 1785, dau. of Isaac
S12 HISTORY OF ASHBURNHAM. 10 11 12 13 14 (2) 15 16
17 <3) 18 19 Miller, q. v. They resided in this town a short time after
marriage, and in New Hampshire and Vermont; he d. about 1815;
his widow md. (2d) Dec. 25, 1817, Amos Stearns of Winchendon,
whose first wife was Deborah Hunt, dau. of Dea. Sherebiah Hunt. 1.
Joseph Bennett, b. April 13, 1805 ; d. July 15, 1835. 2. Laban, b.
April 24, 1807 ; d. July 5, 1844. 3. Alonzo, b. March 11, 1809; d.
Aug. 2, 1857. 4. Sally L., b. June 2, 1811. 5. Sarah A., b. April 16,
1813 ; md. Prentice Britton of Northfield. V. Timothy, h. Oct. 9,
1785; he was taxed a few years in this town. He md. Sally Whiting
of Lancaster and removed to Vermont. VI. Eliza, b. Dec. 7, 1788 ;
md. Stephen Gibson of Ashby. She d. March 18, 1861. Among their
children is Eber Gibson of this town. Edward Maynard md. March 31,
1801, Persis Gates, dau. of Henry Gales, g. v. He was one of the
Ashburnham Light Infantry when in service in the War of 1812. He
d. Oct. 9, 1825 ; she d. in Fitchburg 1861. I. Levi, b. March 19, 1806
; was a blacksmith in this town, where he d. June 9, 1831. He md.
March 5, 1829, Harriet French of Templeton. II. Eliza, b. Sept. 23,
1808 ; md. Alfred M. Wheeler of Fitchburg. III. Sarah Laioreyice, b.
Dec. 20, 1814; md. Josiah W. Boutelle. Stephen Maynard dau. of
Jesse Ellis, q. stead. He d. Aug:. 3, md. April 7, 1803, Miriam Ellis, V.
He was a farmer on the home1840 ; she d. March 14, 1853. Horace,
b. Nov. 4, 1804 ; md. 1828, Lydia Frothingham of Lancaster. He was
a farmer ; d. in this town Aug. 19, 1849. There were five children ;
the birth of twins, Lydia A. and Luc}^ Jane, b. March 19, 1831, is
found in towiti records. The widow and children removed from town
1850. Dorothy, b. Jan. 3, 1806 ; md. John Brown, q. v. ; md. (2d)
Ohio Whitney, Sen., g. v.
20 21 22 23 24 25 26 GENEALOGICAL REGISTER. gi^ III.
Lucy^ b. Jan. 23, 1808 ; md. Joel H. Litch, q. v. Dayid Maynard, son
of David, Jr., and a first cousin of Nebemiali Maynard, md. June 11,
1767, Sarah Savage. The}^ were admitted to the church 1772, and
in 1804 were dismissed to Chittenden, Vt. In the meantime seven
children were baptized. It is probable that they lived over the line in
Westminster. Levi Maynard md. 1812, Phebe (Wright) Winter, widow
of John Winter, q. v. He removed to this town, leaving twelve
children b}' a former marriage, and d. here Dec. 30, 1822. He was a
brother of David Maynard. His widow md. (3d) Aug. 13, 1829,
Benjamin Hawks ; he d. about 1840 ; and last of all she d. Dec. 27,
1847. Antipas Matxard, son of Antipas and Sally (Rice) Maynard, was
b. in Sullivan, N. H., Dec. 31, 1801. He md. Dec. 3, 1822, Almira
Samson, dau. of Oliver Samson, q.v. He resided a few years in
Keene, N. H., and in 1833 removed to this town, where they lived to
an advanced age. Mr. Maynard was a man of generous sympathies
and an ardent temperament. His faith and courage were never
clouded. In business affairs he was exact and honest, and in his
social relations he was kind and considerate. In every good work his
sympathies were spontaneous and his adherence loyal and firm. He
was prominent in the Methodist church, and for many years his
efforts were unabated and his influence continually renewed. His
worthy example lives in the memory of his associates and in the love
of his children. He d. Nov. 18, 1882 ; his widow d. July 29, 1886. I.
Nancy A.,h. Oct. 27, 1823 ; md. Charles Winchester, son of Caleb
Winchester, q. v. II. George A., b. March 3, 1826 ; md. Sept. 25,
1848, Sarah A. Merry, b. Aug. 5, 1827, dau. of Capt. John and Sarah
A. Merry of Edgecomb ; she d. Sept. 2, 1870 ; he md. (2d) Oct. 12,
1872, Mary E. McLean, b. Oct. 12, 1847, dau. of Anthony and Martha
McLean of Shelburne. Eight children. He is a commission merchant :
resides in Somerville. III. Lambert 3L, b. March 26, 1828 ; md. Feb.
17, 1853, Rose W. Knight, b. Oct. 31, 1828, dau. of Asa and Susan
M. Knight ; resides in Somer^ ville.
su HISTORY OF ASHBURNHAM. 27 28 29 30 31 32 33 34
35 36 37 IV. Abbie S., b. Aug. 11, 1830; md. July 2, 1848, Stillman S.
Knapp, b. March 6, 1825, son of Eliab and Rachel Knapp of Mason,
N. H. ; he resides in Gardner. V. Lizzie a, b. May 23, 1833; md. Nov.
22, 1854, Oliver D. Wilder, b. Aug. 25, 1830, son of Josiah P. and
Amanda (Carter) Wilder of New •Ipswich. He was in the service in
the Civil War from this town. In 18 — he removed to Lowell. VI.
Infant, b. and d. Mav 11, 1834. VII. Jane A., b. March 27, 1836 ; md.
Nov. 22, 1854, Frank W. Cummings, b. Jan. 31, 1831, son of George
Cummings of Plymouth, N. H. ; resides in Shirle3^ VIII. Elliot ^., b.
Oct. 14, 1839; md. April 6, 1864, Mary Jane Clark, who d. Jan. 14,
1874 ; md. (2d) May 4, 1873, Abbie B. Caswell. He is a carpenter in
Ashburnham and postmaster at Central Village. 1. Irving E., b. Oct.
3, 1868. 2. Mamie Addie, b. May 2, 1871 ; d. April 20, 1873. IX.
Susan II., b. March 8, 1841 ; md. Frank W. Wallace, q. V. X. Ilarj/
Isabel, b. July 20, 1843 ; md. Nathan Eaton, q. V. XI. Charles
Wesley, b. Oct. 21, 1845. He was a railroad conductor; d. unmd. at
Houston, Texas, Oct. 18, 1873. XII. Emma C, b. Nov. 4, 1848; md.
Nathan Eaton, q. V. Daniel McTntire was b. in Reading July 2, 1781.
He was a son of Daniel and Jane (Hutchinson) Mclntire of Reading
and later of Fitchburg. He md. April 24, 1808, Sally Billings, dau. of
Joshua Billings, q. v., and settled on the north turnpike on the farm
now occupied by his sons. He d. Aug. 27, 1860 ; his widow d. Aug.
18, 1871. I. Lewis, b. Sept. 29, 1808 ; md. May 7, 1846, Syrena
Whitney, b. Oct. 16, 1808, dau. of Benjamin and Nancy (Fuller)
Whitney of Marlboro', N. H. ; she cl. July 9, 1851 ; he resides on the
homestead.
GENEALOGICAL REGISTER. 315 3 II. Daniel^ b. Nov. 24,
1810; iinmcl. ; resides on the homestead. 4 III. Allen^ b. June 3,
1818 ; unmd. ; resides on the homestead. 5 IV. Lavina, b. April 4,
1823 ; d. young. 6 V. Jane E., b. Feb. 11, 1825; md. Jan. 1, 1846,
Luther L. Howard of Royalston ; resides in Nashua, N. H. Jacob
McIntire, a brother of Daniel Mclntire (1), removed to Jefferson
county. New York, and there md. Polly Russell. In 1840 he removed
to this town. He was a farmer and a blacksmith and resided on the
farm more recently of his son. Parley Mclntire. He d. Aug. 9, 1863 ;
she d. May 8, 1868. I. Adaline, b. ; md. Feb. 17, 1840, Timothy
Metcalf, b. Jan. 26, 1798, son of Timotliy and Ruth (Chaplin) Metcalf
of Rindge ; she d. July 28, 1843. 9 1. Timothv, b. June 15, 1841. 10
2. Adaline, b. July 21, 1843; d. Aug. 16, 1843. 11 II. Jane, b. ; md.
April 15, 1839, Joseph Davis, son of Ebenezer Bennett Davis, q. v. 12
III. David Dean, b. Oct. 13, 1826 ; md. June 19, 1850, Hannah S.
Cowdre}^, dan. of Jacob and Hannah (Blood) Cowdrey ; she d. June
19, 1880; he md. (2d) Feb. 5, 1881, Eunice M. Buxton. He is a
farmer in the north part of the town on the Benjamin farm. 13 1.
Adaline Maria, b. Oct. 13, 1852; d. unmd. July 2, 1875. 14 2.
Edward, b. Feb. 1, 1854; md. Aug. 21, 1875, Mary Emily Marcy, dan.
of Washington Marc}' of Holland. He resides in Rindge. Three
children. 15 3. Amanda, T). 1856; d. Jan. 2, 1863. 16 4. Mary, b.
Dec, 1857 ; d. April 13, 1858. 17 5. Arthur, b. Jan. 29, 1859 ; d.
young. 18 6. Talbot, b. Jan. 13, 1861 ; md. 1882, Isabel Blankinship
; resides in Boston. 19 7. Waterman, b. Nov. 8, 1863; md. Jan.,
1887, Emeline Nichols. 20 8. Frederick L., b. Aug. 5, 1865.
816 HISTORY OF ASHBURNHAM. 21 22 23 24 25 26 27 28
29 30 31 32 IV. Robert White, b. April 7, 1828 ; md. June 30, 1853,
Eliza K. Cowdrey, b. Jan. 26, 1827, dau. of Jacob and Hannah
(Blood) Cowdrey. He is proprieter of the Corey Mills near the line of
Rindge, and for several years has been one of the road
commissioners. 1. Emma Clara, b. Oct. 7, 1854 ; d. Oct. 18, 1854. 2.
Flora Helen, b. Nov. 2, 1856 ; d. Nov. 16, 1862. 3. Walter Herbert, b.
Jan. 9, 1858 ; d. Oct. 25, 1862. 4. Carrie Belle, b. Ma3^15, 1861 ;
md. James A. Lane, son of Allen F. Lane, q. v. 5. Herman R., b. Sept.
10, 1862. 6. Effle E., b. Dec. 28, 1864. 7. Hiland, b. April 18, 1867 ;
d. Sept. 28, 1869. 8. Gertie V., b. Jan. 16, 1869. V. Parley, b. Aug.
23, 1833 ; md. Jan. 1, 1856, Hattie E. Hard}^ of New Ipswich. In
the Civil War he served in the 25th Regiment. 1. RubyS., b. 1860;
md. Charles Wilson; reside in Jalfrev, N. H. 2. Frank, b. June 2*2,
1872. Nathan Melvin was a resident of Dorchester Canada, several
years previous to the incorporation of Ashburnham. He lived in the
ninth school district and near the Amos Pierce farm. He was a farmer
and an innholder. He was chosen a deer reeve in 1765, and
subsequently was an assessor and a selectman. In 1775 his name is
found on the roll of Capt. Davis' company. He was here in 1780 and
was then chosen a surveyor of the highways, but the family removed
soon after that date. The name of his wife was Anna ; six or more
children were b. in this town. Mary Melvin, probably a relative and
possibly an elder dau., md. Sept. 11, 1770, John Bigelow. I. Anna, b.
Nov. 8, 1760. II. Sarah, b. Sept. 15, 1762. III. Phehe, b. March 27,
1765. IV. Hepsihah, b. March 24, 1767. V. Nathan, b. March 1, 1769.
VI. Theodore, b. May 1, 1771.
GENEALOGICAL REGISTER. 817 MERRIAM. During the
Revolution, and until the close of the century, a family of Merriam
resided in this town, but none of the descendants of this family
appear among the later inhabitants of Ashburnham. Isaac Merriam,
the head of this family, was of the fifth generation of Merriam in this
country. Through valued favors of George O. Merriam of Dorchester
this register is rendered more complete. Joseph Merriam, a son of
William and Sarah Merriam of Hadlowe, county of Kent, England,
with wife Sarah, is found residing in Concord at an early date. He
was admitted freeman March 14, 1638, and d. Jan. 1, 1641. Joseph
Merriam, probably the eldest of three sons, was b. 1630; he md. July
12, 1653, Sarah Stone, b. 1633, dau. of Dea. Gregory Stone. He was
admitted freeman May 22, 1651; he d. April 20, 1677; his widow d.
April 8, 1704. Thomas Merriam, son of Joseph and Sarah (Stone)
Merriam, b. 1672, md. Dec. 23, 1696, Mary Hayward, and resided in
Lexington, Avhere he was a constable and selectman several years.
He d. Aug. 16, 1738; his widow d. Sept. 29, 1756. The youngest of
several sons was Isaac Merriam, b. July 11, 1714. He md. Sarah
Davis, and among his children was Isaac Merriam of Ashburnham.
Benjamin Merriam, number 32, was of the seventh generation in this
country, and was a descendant of John, another son of Joseph and
Sarah (Stone) Merriam. He was b. May 30, 1662; md. 1688, Mary
Wheeler of Concord ; resided at Cambridge Farms, now Lexington,
and was one of the most prominent men of the parish and of the
town. He d. May 21, 1727; his widow d. Dec. 26, 1747. His son,
Jonas Merriam, bap. Jan. 12, 1704, md. Oct. 3, 1728, Abigail Locke,
b. June 22, 1710, dau. of Dea. William and Abigail (Hayward) Locke
of Woburn; she d. Dec. 5, 1755; he md. (2d) June 22, 1758, Sarah
Winship. He lived in Lexington and was frequently chosen to office.
He d. July 23, 1776; his wife d. March 15, 1773. Abraham Merriam,
son of Jonas, b. Dec. 23, 1734, md. April 22, 1756, Sarah Simonds,
b. April 25, 1739, dau. of Daniel and Abigail (Smith) Simonds. They
lived some years in Lexington and about 1767 removed to Woburn,
where their son, Ezra Merriam, was b. June 15, 1760. He md. Susan
Elliot and resided in Mason, N. H. Isaac Merriam, son of Isaac and
Sarah (Davis) Merriam, was b. in Concord 1736. He md. April 10,
1759, Eleanor Munroe of Lexington who d. in Concord July 19, 1767;
he md. (2d) Dec. 2, 1767, Kebecca Davis of Acton. With four children
he removed to Ashburnham in 1772 or early in 1773, He was a
selectman and prominent in the affairs of the town. In 1793 he
removed to Groton, N. H. I. David^ b. in Concord Jan. 28, 1760.+
II. Isaac^ b. in Concord Jan. 29, 1762. + III. Jonathan., b. in
Concord July 6, 1764.+ IV. Benjamin^ b. in Concord July 9, 1767;
Malone, N. Y. v. Rebecca., b. in Concord Nov. 12, 1771. VI.
Joshua.,}), in Ashburnham Nov. 11, 1775 Malone, N. Y. VII. Jonas, b.
in Ashburnham April 25, 1780 ; lived in Brandon, Vt. 52 in d. in
818 HISTORY OF ASHBURNHAM. (2) 9 10 11 12 13 14 15
16 17 (3) Capt. David Merrtam came to this town with the family ;
was a soldier in the Revolution. Vide page 192. He md. Nov. 21,
1782, Phebe Foster, dau. of Moses Foster, Jr., q. v., and soon after
this marriage he removed to Brandon, Vt. His wife d. April 7, 1794,
and he again appears in the records and is styled Capt. David
Merriam, and md. Feb. 10, 1795, Betty Conant, dau. of Ebenezer
Conant, Jr., q. v. He d. in Brandon, Vt., Feb. 15^ 1849 ; his wife d.
June 3, 1842. I. FJiebe, b. Dec. 26, 1783. II. David, b. June 9, 1786.
III. George W., b. Oct. 4, 1787. IV. Isaac Foster, b. July 27, 1790. V.
Cyrus, b. July 14, 1793. VI. Betsey, b. Sept. 13, 1796. VII. Alvin, b.
March 26, 1802. VIII. Angeline E., b. July 18, 1808. IX. Daniel D. 18
19 20 21 22 23 24 25 (4) 26 27 28 29 30 31 Isaac Merriam was a
soldier in the Revolution. Vide page 191. After the war he removed
from this town and subsequently lived in Northumberland, N. H. He
md. 1786, Betsey Wait, b. April 8, 1765. He d. in Jackson, N. Y., Feb.
1, 1853. Two of his children are living in Northumberland. I. David,
b. May 5, 1790. II. Isaac, b Feb. 24, 1792. III. Betsey, b. March 2,
1794. IV. William, b. March 21, 1796 ; d. July 5, 1814. V. Jonas, b.
May 23, 1798. VI. Benjamin, b. Sept. 15, 1801. VII. Joseph Waile, b.
Aug. 27, 1803. VIII. Sarah, b. March 31, 1808. Jonathan Merriam
md. Nov. 6, 1788, Sarah Conant, dau. of Ebenezer, Jr., q. v. He
resided in this town until near the close of the century and removed
with other families to Brandon, Vt., perhaps in 1798. He was a
captain of the militia in this town. He d. April 26, 1826. I. Isaac, b.
Oct. 25, 1789. II. Jonathan, b. Nov. 5, 1791. III. Sarah, b. Aug. 31,
1794 ; md. Rev. Samuel Waite, D. D. IV. Abel Wood, b. . V. Nylon, b.
. VI. Lydia, b. ; md. Jacob Powers of Brandon.
GENEALOGICAL REGISTER. 81^ 32 33 34 35 36 37 38 39
40 Benjamin Merriam, son of Merriam, was b. in Mason, N P^zra
and Susan (Elliot) , H., May 13, 1802. He md. Nov. 4, 1832, Irene
Knapp, b. Jan. 4, 1812, dan. of Elijah and Rhoda Knapp, of Mason,
N. H. The family removed to this town in 1845, where he was
engaged some years in the stove and hardware trade. He d. Aug 5,
1872. I. II. III. IV. V. VI. VII. VIII. Benjamin F., b. Sept. 7, 1833 ; d.
Nov. 27, 1865. Henry A., b. June 16, 1835 : d. March 28, 1865.
George E., b. Sept. 3, 1837 ; d. March 25, 1842. Emily E., b. July 7,
1842 ; md. Francis J. Litch, q. V. Susan 3L, b. July 16, 1844 ; d. Dec.
13, 1861. Abbie /., b. Oct. 16, 1846; md. June 2, 1867, William H.
Richardson of Ashburnham. He is a manufacturer of carriages and a
dealer in carriages, sleighs and furnishings. Laura E., b. Jan. 7, 1849
; d. March 2, 1878. Clarabell A., b. Aug. 7, 1853 ; d. May 21, 1882.
MERRIAM. The families of Merriam included in the following register
are a branch of the Marion family. The name of Merriam was
assumed by William and Joseph of Ashburnham and their
descendants, and it appears that Ignatius Marion was the ancestor
of the later families of Merriam in this town. This also accounts for
the name of Meriam which frequently appears in the signatures and
records of the town. John Marion, b. in England 1620, d. in 1705;
Sarah, his wife, b. 1725, d. Feb. 3, 1709. Samuel Marion, son of
John and Sarah, b. Dec. 14, 1655, lived in Boston, Charlestown and
again in Boston. He md. Hannah , who d. April 4, 1688. Eeference is
made to her death in Sew all's Diary : " At night Sam Marion's wife
hangs herself in the chamber, fastening a cord to the Rafter Joice;
two or three said she was distracted and had been for some time.
She was buried in the burying place." He md. (2d) Mary Wilson, dau.
of Edward and Mary (Hale) Wilson of Charlestown. He d. Aug. 6,
1726. Among the twelve children of Samuel Marion was Isaac
Marion, a son of the second wife, b. in Charlestown March 8, 1694.
He md. July 7, 1717, Rebecca Knight, and of their five children
Ignatius, the second son, came to Ashburnham, and Rebecca, the
youngest, b. Oct. 18, 1730, d. here unmd. June 2, 1816. Ignatics
Merriam, son of Isaac and Rebecca (Knight) Merriam, was b. Aug.
15, 1724. He lived in Lexington, where the birth of children
Susannah and Joseph are recorded, and in Woburn. Joseph, in his
affidavit, page 209, alleges that he was b. in Woburn. I have found
no record of his marriage. After his children were married and
settled in life he came to this town, where two sons were living,
about 1790. He d. April 3, and his wife d. April 2, 1799 ; they were
buried in one grave in the old cemetery.
820 HISTORY OF ASHBURNHAM. (7) 9 10 11 12 13 14 (8)
15 16 17 18 19 20 21 22 23 I. Mary^ b. Feb. 9, 1749 ; md. Draper.
II. Susannah, b. Jan. 9, 1751; md. April 8, 1777, Ephraim Winship,
b. in Lexington June 25, 1753, son of Ricliard Winship. III. Sarah, b.
June 19, 1754; md. Reed. IV. Hepsihah^ b. Aug. 2, 1756 ; md.
Wetberbee. V. Abigail^ b. March 20, 1760 ; d. unmd. in
Francestown, N. H. VI. Joseph.h. Feb 3, 1763. + VII. William, b.
Sept. 12, 1767. + Joseph Merriam md. Sept. 25, 1782, Phebe
Russell, b. May 24, 1764, dau. of Philip and Lydia (Dodge) Russell of
Lexington. He lived a short time in Bedford, removing to this town in
1784. He lived at the centre of the town, in the northwest, and
subsequently in the southwest part of the town, near the toll-gate.
He d. April 4, 1849, aged 86 years ; recorded 88 ; she d. May 29,
1845, aged 81 years; recorded 71. I. Philip Russell, b. Jan. 4, 1784.-
|II. Joseph, b. Aug. 19, 1785.+ III. Nathan, b. Oct. 21, 1787; d. in
Ashburnham unmd. April 7, 1851. IV. Phebe, b. Dec. 13, 1789 ; md.
Philip Bowman, son of John Bowman, q. v. V. Jonas, b. Nov. 25,
1804 ; removed to New Orleans, La., where he d. unmd. Oct. 23,
1832. VI. Joshua, b. Oct. 10, 1807. + William Merriam md. Oct. 30,
1788, Rebecca Metcalf, dau. of Joseph Metcalf, q. v. He was a
blacksmith and lived near Factory Village. He is remembered as a
man of good character and an excellent citizen. He d. June 11,
1834; shed. Dec. 9, 1831. I. William S., b. Feb. 14, 1789. + II.
Ezekiel, b. May 17, 1792.-}III. Moses B., b. March 19, 1794; md.
March 14, 1824, Abigail Simonds ; was a machinist ; d. in Northboro'
Dec. 24, 1876 ; his wife d. Dec. 17, 1870. IV. Rebecca, b. Dec. 12,
1796 ; d. April 1, 1819. V. Margaret S., b. April 26, 1800 ; d. June
10, 1830. VI. Joel, b. Jan. 28, 1802.+ VII. James, b. Oct. 16, 1803.
+ VIII. Asa, b. Feb. 2, 1810. + IX. Sarah R,, b. Sept. 20, 1816 ; d.
Jan. 15, 1817.
(9) 24 25 26 (10) GENEALOGICAL REGISTER. 821 Philip R.
Merriam was a merchant and a manufacturer of chairs in this town,
and for many years he was engaged in teaming between
Ashburnham and Boston. He* was enterprising and ambitious and,
until the advent of the Winchesters, who were his successors in the
chair business, he was the principal supporter of the activities of the
town. He md. Oct. 2, 1806, Sally Sanderson, dau. of Moses
Sanderson, g. ^^ ; she d. Oct. 15, 1843; md. (2d) Sept. 6, 1844,
Ruth (Wallis) Morton, widow of John D. Morton, q. v. He d. April 29,
1880 ; his wife d. June 7, 1865. I. Philip Russell, b. May 29, 1807. +
II. Otis Whiton, b. May 27, 1812. + III. Francis Henry, b. Sept. 23,
1845 ; d. unmd. April 14, 1869. Joseph Merriam, son of Joseph, md.
Sept. 11, 1806, Betsey Adams; md. (2d) May 4, 1809, Betty (Gates)
Wheeler, widow of Josiah Wheeler of Gardner and dau. of John
Gates, q. v. He removed 1807 to Boxboro' and subsequently lived in
Chesterfield, N. H., and in Royalston. Hed. Oct. 11, 1850. I. Josiah
TK, b. June 12, 1809 ; was a merchant in ) Baltimore; md. Eliza Ann
Rowell ; md. (2d) Catherine Hall. Six children, n. Elizabeth A., b.
April 12, 1811 ; unmd. III. John G.,\>. April 18, 1813; md. May 12,
1833, Sarah F. Warren ; lived several years in Leominster. Four
children. Sultina H., b. June 23, 1815 ; md. Nov. 17, 1842, Edward
H. Reif ; removed to Baltimore. Six children. V. Sarah G., b. May 7,
1817; md. Sept. 3, 1849, George W. E. Kelley of Hopkinton, N. H.
Two children. 32 I VI. Nancy H., b. Oct. 26, 1819 ; md. June 20,
1859, Benjamin B. Howell. Five children. VII. Aima r., b. Aug. 26,
1822 ; md. Sept. 3, 1845, Henry Bisselle. Three children. 27 28 29
30 31 33 IV (14) Joshua Merriam md. Nov. 19, 1835, Nancy W.
Hoibrook, dau. of Jesse Holbrook, g. v. She d. July 30, 1852 ; md.
(2d) Nov. 14, 1852, Roxanna Fassett of FilzwiUiam, N. H., who d.
Oct. 3, 1859; md. (3d) June 1, 1861, Jane R. Wood, b. in England, a
sister of Rev. Pliny Wood. He is a shoemaker in Central Village.
822 HISTORY OF ASHBURNHAM. 84 35 36 (15) 37 38 39
40 41 42 43 44 45 46 I. Sarah E., b. May 21, 1839 ; rnd. March 10,
1868, Harding G. Woodward of Greenfield ; he d. March 9, 1884.
Three children. II. JaneE., b. Sept. 29, 1840; d. Feb. 14, 1844. III.
Effie Jane, b. June 2, 1863. William S. Merriam md. March 10, 1810,
Martha Lawrence, dan. of Amos Lawrence, q. v. He was a blacksmith
in this town and lived on the Amos Whitney farm and near the
homestead of his father. In 1841 he removed to Ciielsea. He d. Aug.
3, 1878; she d. Aug., 1872. I. Otis, b. Sept. 14, 1810 ; md. Jan. 1,
1830, Abigail R. Savils ; removed to Chelsea 1832 ; his wife d. May
7, 1839; md. (2d) Oct. 10, 1839, Harriet Lamont. He has continued a
residence in Chelsea man}^ years, and was an auctioneer and an
insurance and real estate agent. A few years ago he began business
at Putnam, Conn., and until recently was president of the Putnam
Gas Light Company. Four children. II. Ezra Laivrence, b. Feb. 28,
1812 ; md. Aug. 27, 1835, Eliza B. Prescott who d. July 12, 1865 ;
resides in Putnam, Conn. III. Martha M., b. Oct. 10, 1814; md.
Lyman Wood of Fitchburg ; she d. March 8, 1839. IV. William
Newton, b. Nov. 15, 1816; md. 1841, Abigail Lord of Sanbornton ;
removed to Chelsea ; md. (2d) Margaret Clark ; served in 40th Mass.
Regiment and d. in Andersonville prison. V. Susan Augusta Wilson, h.
Nov. 8, 1818 ; md. Dec. 12, 1855, William E. Stanwood. VI. Liberty,
b. Jan. 16, 1821 ; md. March 8, 1844, Lucinda Douglas ; md. (2d)
1854, Mary Ann Heath. He was a manufacturer of wall paper. Elvira,
b. Dec. 31, 1822; md. May 22, 1844, VII. VIII. IX. George G.
Desmezes ; resides in Chelsea, Sultina Townsend, b. June 15, 1825 :
1845, William E. Stanwood ; she 1853. Jeremiah Metcalf, b. July 7,
1827 ; 1847, Elizabeth Moseley ; was a of wall paper. md d. Oct. 2,
May 8, X. Sarah, b. Nov. 6, 1829 d. Aug. 17 md. Nov. 7,
manufacturer , 1832. (16)j EzEKiEL Merriam md. Nov. 23, 1815,
Nancy Reed, I dau. of Jonas Reed, q. v. He was a stone-cutter and
47 48 49 51 52 53 {20) 54 55 56 57 58 59 60 61 (21)
GENEALOGICAL RE(HSTEU. §23 resided in Mason, N. H., and in this
town. He d. Jan. 25, 1863 ; she d. Nov., 1875. I. Nancy, b. Aug. 26,
1816 ; md. Sept. 12, 1838, George Howard ; she d. in Ashby March
2, 1848. II. William Johnson, b. Aug. 25, 1818 ; md. June 1, 1842,
Matilda Russell of Boston ; he d. at Auburndale Dec. 16, 1875. III.
Rebecca, b. Feb. 5, 1822 ; d. Feb. 25, 1822. IV. Rebecca, b. June 8,
1824 ; md. Nov. 19, 1840, Harvey Howard ; she d. at Nashua, N. H.,
Aug. 26, 1870 ; he d. Feb. 6, 1874. V. George W., b. Aug. 12, 1827;
md. Nov. 1, 1850, Caroline Sears. VI. Sarah, b. Jan. 18, 1832; md.
May 12, 1853, Theodore H. Wood, b. in Littleton April 13, 1830. Mr.
Wood removed from Worcester to Nashua in 1852. He was treasurer
of the Nashua and Lowell Railroad several years and president of the
Manchester and Keene Railroad. Sarah (Merriam) Wood d. Sept. 5,
1880. 1. Clara Abbott, b. July 2, 1854; md. April 15, 1875, Francis E.
Nims who d. June 1, 1881. Joel Merriam md. 1826, Deborah Cook,
dau. of John Cook, q. V. ; resided in this town ; he d. Dec. 17, 1858 ;
she d. 1877. I. John Cook, b. June 15, 1827 ; md. Oct. 7, 1849,
Sophronia A. Chase of Leominster ; resides in Athol. II. Rosilla, b.
Nov. 9, 1828 ; d. March 7, 1831. III. Rosilla, b. Dec. 5, 1831. IV.
Mary E.,h. June 15, 1834; md. Job Foster of Ashby ; he d. March 14,
1877. Six children, V. Edwctrd Balcom, b. 1841 ; served in 36th
Regiment ; resides in Lawrence. VI. Anqeline, b. ; md. William Drury
; she d. in Worcester 1882. VII. Rhoda, b. ; md. Samuel McC ;
resides in Lawrence. VIII. Melinda, b. Feb. 16, 1847; md. Clarence
Upton; resides in Lawrence. James Merriam, son of William, md.
1827, Susan Bemis, b. in Winchendon May 27, 1807, dau. of Abel
824 HISTORY OF ASHBURNHAM. 62 63 (22) 64 65 66 67
68 (24) 69 70 71 (25) Bemis. He resided in this town where he d.
July 31, 1840 ; she md. (2d) Hosea Green, q. v. I. Dolly, b. Nov. 2,
1830 ; d. Sept. 13, 1833. II. Dolly A., b. Aug. 26, 1834, md. Prof.
Levi W. Russell, q. v. Asa Merriam resided in this town until about
1848^ when he removed to Gardner. He was much employed in
town affairs ; was captain of the Light Infantry and represented the
town of Gardner in the Legislature. He md. Oct. 11, 1832, Almira B.
Crosby, dau. of Frederic Crosby, q. v. She d. Feb. 13, 1845; md. (2d)
1845, Mary Barker, b. Aug. 31, 1811, whod. Aug. 13, 1864; md. (3d)
Esther C. Ryan, b. May 27, 1825 ; d. March 23, 1883. He d. in
Gardner Jan. 24, 1885. I. Milton, b. April 29, 1835 ; md. Elizabeth G.
Watts, b. March 30, 1837 ; resides in Gardner. II. Lavina, b. March
30, 1837. m. Mary Almira, b. Dec. 28, 1846. IV. Frances Neuton, b.
Jan. 9, 1848 ; d. Sept. 23, 1848. V. Austin, b. May 25, 1852 ; d. Nov.
18, 1852. Philip R. Merriam, Jr., was engaged in business with his
father and subsequently was a merchant in this town. He removed in
1840 to Chelsea and was in trade in that city and in Boston. He md.
July 2, 1835, Helen A. Smallpeace, b. in Boston Feb. 20, 1816, dau.
of Robert and Hannah (Stevens) Smallpeace. He d. March 25, 1879 ;
his widow resides in this town. III. Helen Maria, b. April 27, 1838 ; d.
May 16, 1852. Florence Otis, b. Oct. 24, 1853 ; md. Jan. 24, 1817.
Frank H. Parker, son of Jesse Parker, q. v. Abbott Smallpeace, b. Sept
4, 1855 ; md. Aug. 31, 1880, Jennie Fleming ; resides in Boston.
Otis W. Merriam was associated with his father in the manufacture of
chairs and subsequently was a partner of Charles Winchester. At his
suggestion many substantial innovations were adopted, and while he
remained in this town he was an important factor in the
development of an industry which has contributed to the prosperity
of the town. Subsequent!}' he was engaged in business in Boston
and in California. He now resides, an invalid, in Chelsea. He md.
Hepsev Gibson, dau. of Samuel Gibson of Ashby. She d. June 27,
1843 ; he md. (2d) .
The text on this page is estimated to be only 0.00%
accurate

^syc^/f>^^-^L^^^{^7>c
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookfinal.com

You might also like