Skip to content

Commit

Permalink
Csv import to supabase (#505)
Browse files Browse the repository at this point in the history
* add senses and sentences
* import dialects
* import photo and audio
* fix onondaga sort
* save import content updates
* don't write log files in CI
* only do content_updates for entry to denote import_id
* add tags to db and separate multiples in same column of imports with pipe
* fix multiple senses when having multiple audio bug
  • Loading branch information
jacob-8 authored Nov 28, 2024
1 parent 058be3e commit e9d82bb
Show file tree
Hide file tree
Showing 91 changed files with 2,365 additions and 5,132 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/supabase-tests.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Supabase DB Vitest Tests
on:
pull_request:
branches: [ main ]
branches: [main]

jobs:
build:
Expand All @@ -28,3 +28,5 @@ jobs:

- name: Run DB Tests
run: pnpm test:db:ci

# - run: pnpm -F scripts test:import # TODO: ordering needs made deterministic before we can run this
11 changes: 0 additions & 11 deletions packages/functions/.gitignore

This file was deleted.

5 changes: 5 additions & 0 deletions packages/functions/deleteMediaOnDictionaryDelete.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// const bucket = admin.storage().bucket()

// return bucket.deleteFiles({
// prefix: `${dictionaryId}`,
// })
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ export const entryInterface = {
ca: 'created at',
ua: 'updated at',
ei: 'Elicitation Id',
};
}
35 changes: 0 additions & 35 deletions packages/functions/package.json

This file was deleted.

46 changes: 46 additions & 0 deletions packages/functions/recursiveDelete.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// import * as functions from 'firebase-functions';
// const firebase_tools = require('firebase-tools');

// /**
// * Initiate a recursive delete of documents at a given path.
// *
// * The calling user must be authenticated and have the custom "admin" attribute
// * set to true on the auth token.
// *
// * This delete is NOT an atomic operation and it's possible
// * that it may fail after only deleting some documents.
// *
// * @param {string} data.path the document or collection path to delete.
// */
// export default async (data: any, context: functions.https.CallableContext) => {
// // if (!(context.auth && context.auth.token && context.auth.token.admin)) {
// // Only allow authorized users to execute this function. // Could improve by reading user data from Firestore and looking at admin role > 1
// if (
// !(
// context.auth &&
// (context.auth.uid === '0seqYnZOqkUz050y6jVQI9QvlW62' ||
// context.auth.uid === '2PELJgjxMHXEOcuZfv9MtGyiXdE3')
// )
// ) {
// throw new functions.https.HttpsError(
// 'permission-denied',
// 'Must be an administrative user to initiate delete.'
// );
// }

// const {path} = data;
// console.log(`User ${context.auth.uid} has requested to delete path ${path}`);

// // Run a recursive delete on the given document or collection path.
// // The 'token' must be set in the functions config, and can be generated
// // at the command line by running 'firebase login:ci'.
// await firebase_tools.firestore.delete(path, {
// project: process.env.GCLOUD_PROJECT,
// recursive: true,
// yes: true,
// token: functions.config().fb.token,
// });
// return {
// path,
// };
// };
19 changes: 0 additions & 19 deletions packages/functions/src/aggregation/countAllEntries.ts

This file was deleted.

17 changes: 0 additions & 17 deletions packages/functions/src/aggregation/index.ts

This file was deleted.

14 changes: 0 additions & 14 deletions packages/functions/src/auth.ts

This file was deleted.

15 changes: 0 additions & 15 deletions packages/functions/src/config.ts

This file was deleted.

5 changes: 0 additions & 5 deletions packages/functions/src/db.ts

This file was deleted.

15 changes: 0 additions & 15 deletions packages/functions/src/deletion/deleteMediaOnDictionaryDelete.ts

This file was deleted.

46 changes: 0 additions & 46 deletions packages/functions/src/deletion/recursiveDelete.ts

This file was deleted.

124 changes: 0 additions & 124 deletions packages/functions/src/export/semanticDomainOfDictionary.ts

This file was deleted.

Loading

0 comments on commit e9d82bb

Please sign in to comment.