Skip to content

Commit

Permalink
feat: seed captures and tress from production data
Browse files Browse the repository at this point in the history
  • Loading branch information
gwynndp committed Feb 24, 2022
1 parent 795d5ed commit 6ca856a
Show file tree
Hide file tree
Showing 9 changed files with 475,016 additions and 51,014 deletions.
2 changes: 1 addition & 1 deletion database/seeds/02_captures.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const captures = require('./data/Captures-1.json');
const captures = require('./data/Captures.json');

exports.seed = function (knex) {
// Deletes ALL existing entries
Expand Down
475,003 changes: 475,003 additions & 0 deletions database/seeds/data/20220130-Captures.json

Large diffs are not rendered by default.

File renamed without changes.
File renamed without changes.
26,002 changes: 0 additions & 26,002 deletions database/seeds/data/Captures-1.json

This file was deleted.

25,002 changes: 0 additions & 25,002 deletions database/seeds/data/Captures-2.json

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const trees = require('./data/Trees-1.json');
const trees = require('../data/Trees-1.json');

exports.seed = function (knex) {
// Deletes ALL existing entries
Expand Down
2 changes: 1 addition & 1 deletion server/__tests__/utils.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { knex } = require('../infra/database/knex');
const knex = require('../../database/connection');

function parsePoint(json) {
for (const key in json) {
Expand Down
17 changes: 10 additions & 7 deletions tools/create-testing-data.sql
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@

INSERT INTO treetracker.capture
(
reference_id,
image_url,
reference_id,
image_url,
lat,
lon,
lon,
gps_accuracy,
estimated_geometric_location,
grower_account_id,
Expand All @@ -16,9 +16,11 @@ session_id,
created_at,
updated_at,
estimated_geographic_location,
status)
SELECT
id,
status
)

SELECT
id,
image_url,
lat,
lon,
Expand Down Expand Up @@ -57,7 +59,8 @@ created_at,
updated_at,
estimated_geographic_location
)
SELECT

SELECT
id,
image_url,
lat,
Expand Down

0 comments on commit 6ca856a

Please sign in to comment.