removed trash columns and added 102 columns to transaction, made migration Files, added some stuff to misc
This commit is contained in:
+105
@@ -0,0 +1,105 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
// Use raw SQL with CASCADE to drop columns and dependent views
|
||||||
|
DB::statement('ALTER TABLE transactions
|
||||||
|
DROP COLUMN IF EXISTS registry_company_number CASCADE,
|
||||||
|
DROP COLUMN IF EXISTS registry_source CASCADE,
|
||||||
|
DROP COLUMN IF EXISTS registry_match_score CASCADE,
|
||||||
|
DROP COLUMN IF EXISTS registry_data CASCADE,
|
||||||
|
DROP COLUMN IF EXISTS registry_last_refreshed_at CASCADE,
|
||||||
|
DROP COLUMN IF EXISTS genesis_context CASCADE,
|
||||||
|
DROP COLUMN IF EXISTS genesis_last_refreshed_at CASCADE,
|
||||||
|
DROP COLUMN IF EXISTS govdata_data CASCADE,
|
||||||
|
DROP COLUMN IF EXISTS govdata_last_refreshed_at CASCADE,
|
||||||
|
DROP COLUMN IF EXISTS bundesanzeiger_data CASCADE,
|
||||||
|
DROP COLUMN IF EXISTS bundesanzeiger_last_refreshed_at CASCADE,
|
||||||
|
DROP COLUMN IF EXISTS insolvency_data CASCADE,
|
||||||
|
DROP COLUMN IF EXISTS insolvency_last_refreshed_at CASCADE,
|
||||||
|
DROP COLUMN IF EXISTS rss_alerts CASCADE,
|
||||||
|
DROP COLUMN IF EXISTS rss_last_refreshed_at CASCADE,
|
||||||
|
DROP COLUMN IF EXISTS sanctions_data CASCADE,
|
||||||
|
DROP COLUMN IF EXISTS sanctions_last_refreshed_at CASCADE,
|
||||||
|
DROP COLUMN IF EXISTS pep_data CASCADE,
|
||||||
|
DROP COLUMN IF EXISTS pep_last_refreshed_at CASCADE,
|
||||||
|
DROP COLUMN IF EXISTS gleif_lei CASCADE,
|
||||||
|
DROP COLUMN IF EXISTS gleif_data CASCADE,
|
||||||
|
DROP COLUMN IF EXISTS gleif_last_refreshed_at CASCADE,
|
||||||
|
DROP COLUMN IF EXISTS eu_sanctions_data CASCADE,
|
||||||
|
DROP COLUMN IF EXISTS eu_sanctions_last_refreshed_at CASCADE,
|
||||||
|
DROP COLUMN IF EXISTS handelsregister_data CASCADE,
|
||||||
|
DROP COLUMN IF EXISTS handelsregister_last_refreshed_at CASCADE,
|
||||||
|
DROP COLUMN IF EXISTS handelsregister_status CASCADE,
|
||||||
|
DROP COLUMN IF EXISTS handelsregister_entity_id CASCADE
|
||||||
|
');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::table('transactions', function (Blueprint $table) {
|
||||||
|
// Registry Data
|
||||||
|
$table->text('registry_company_number')->nullable();
|
||||||
|
$table->text('registry_source')->nullable();
|
||||||
|
$table->double('registry_match_score')->nullable();
|
||||||
|
$table->jsonb('registry_data')->nullable();
|
||||||
|
$table->timestamp('registry_last_refreshed_at')->nullable();
|
||||||
|
|
||||||
|
// Genesis
|
||||||
|
$table->jsonb('genesis_context')->nullable();
|
||||||
|
$table->timestamp('genesis_last_refreshed_at')->nullable();
|
||||||
|
|
||||||
|
// Govdata
|
||||||
|
$table->jsonb('govdata_data')->nullable();
|
||||||
|
$table->timestamp('govdata_last_refreshed_at')->nullable();
|
||||||
|
|
||||||
|
// Bundesanzeiger
|
||||||
|
$table->jsonb('bundesanzeiger_data')->nullable();
|
||||||
|
$table->timestamp('bundesanzeiger_last_refreshed_at')->nullable();
|
||||||
|
|
||||||
|
// Insolvency
|
||||||
|
$table->jsonb('insolvency_data')->nullable();
|
||||||
|
$table->timestamp('insolvency_last_refreshed_at')->nullable();
|
||||||
|
|
||||||
|
// RSS Alerts
|
||||||
|
$table->jsonb('rss_alerts')->nullable();
|
||||||
|
$table->timestamp('rss_last_refreshed_at')->nullable();
|
||||||
|
|
||||||
|
// Sanctions
|
||||||
|
$table->jsonb('sanctions_data')->nullable();
|
||||||
|
$table->timestamp('sanctions_last_refreshed_at')->nullable();
|
||||||
|
|
||||||
|
// PEP - Politically Exposed Person
|
||||||
|
$table->jsonb('pep_data')->nullable();
|
||||||
|
$table->timestamp('pep_last_refreshed_at')->nullable();
|
||||||
|
|
||||||
|
// GLEIF
|
||||||
|
$table->text('gleif_lei')->nullable();
|
||||||
|
$table->json('gleif_data')->nullable();
|
||||||
|
$table->timestamp('gleif_last_refreshed_at')->nullable();
|
||||||
|
|
||||||
|
// EU Sanctions
|
||||||
|
$table->jsonb('eu_sanctions_data')->nullable();
|
||||||
|
$table->timestamp('eu_sanctions_last_refreshed_at')->nullable();
|
||||||
|
|
||||||
|
// Handelsregister
|
||||||
|
$table->jsonb('handelsregister_data')->nullable();
|
||||||
|
$table->timestamp('handelsregister_last_refreshed_at')->nullable();
|
||||||
|
$table->text('handelsregister_status')->nullable();
|
||||||
|
$table->bigInteger('handelsregister_entity_id')->nullable();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -0,0 +1,241 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::table('transactions', function (Blueprint $table) {
|
||||||
|
// Corporate Information
|
||||||
|
$table->jsonb('corporate_summary')->nullable();
|
||||||
|
$table->jsonb('corporate_history')->nullable();
|
||||||
|
$table->jsonb('corporate_purpose')->nullable();
|
||||||
|
$table->jsonb('corporate_sector')->nullable();
|
||||||
|
$table->jsonb('corporate_nace')->nullable();
|
||||||
|
$table->jsonb('corporate_products')->nullable();
|
||||||
|
$table->jsonb('corporate_markets')->nullable();
|
||||||
|
$table->jsonb('corporate_supply')->nullable();
|
||||||
|
$table->jsonb('corporate_name')->nullable();
|
||||||
|
$table->jsonb('corporate_form')->nullable();
|
||||||
|
$table->jsonb('corporate_forum')->nullable();
|
||||||
|
$table->jsonb('corporate_HQ')->nullable();
|
||||||
|
$table->jsonb('corporate_locations')->nullable();
|
||||||
|
$table->jsonb('corporate_holding')->nullable();
|
||||||
|
$table->jsonb('corporate_shareholders')->nullable();
|
||||||
|
$table->jsonb('corporate_board')->nullable();
|
||||||
|
$table->jsonb('corporate_supervisory')->nullable();
|
||||||
|
$table->jsonb('corporate_powerofattorney')->nullable();
|
||||||
|
$table->jsonb('corporate_taxID')->nullable();
|
||||||
|
$table->jsonb('corporate_LEI')->nullable();
|
||||||
|
$table->jsonb('corporate_UBO')->nullable();
|
||||||
|
$table->jsonb('corporate_employeecount')->nullable();
|
||||||
|
$table->jsonb('corporate_turnover')->nullable();
|
||||||
|
$table->jsonb('corporate_EBIT')->nullable();
|
||||||
|
$table->jsonb('corporate_netprofits')->nullable();
|
||||||
|
$table->jsonb('corporate_balancesheet')->nullable();
|
||||||
|
$table->jsonb('corporate_auditfindings')->nullable();
|
||||||
|
$table->jsonb('corporate_insolvency')->nullable();
|
||||||
|
$table->jsonb('corporate_liquidation')->nullable();
|
||||||
|
$table->jsonb('corporate_adhoc')->nullable();
|
||||||
|
$table->jsonb('corporate_pressrelease')->nullable();
|
||||||
|
$table->jsonb('corporate_votes')->nullable();
|
||||||
|
$table->jsonb('corporate_directordealings')->nullable();
|
||||||
|
$table->jsonb('corporate_brands')->nullable();
|
||||||
|
$table->jsonb('corporate_website')->nullable();
|
||||||
|
$table->jsonb('corporate_domain')->nullable();
|
||||||
|
$table->jsonb('corporate_IBAN')->nullable();
|
||||||
|
$table->jsonb('corporate_solvency')->nullable();
|
||||||
|
$table->jsonb('corporate_rating')->nullable();
|
||||||
|
$table->jsonb('corporate_ESG')->nullable();
|
||||||
|
$table->jsonb('corporate_license')->nullable();
|
||||||
|
$table->jsonb('corporate_warnings')->nullable();
|
||||||
|
$table->jsonb('corporate_eusanctions')->nullable();
|
||||||
|
$table->jsonb('corporate_ofacsanctions')->nullable();
|
||||||
|
$table->jsonb('corporate_uksanctions')->nullable();
|
||||||
|
$table->jsonb('corporate_pepexposure')->nullable();
|
||||||
|
$table->jsonb('corporate_adversemediascanning')->nullable();
|
||||||
|
$table->jsonb('corporate_corruptionexposure')->nullable();
|
||||||
|
$table->jsonb('corporate_AMLexposure')->nullable();
|
||||||
|
$table->jsonb('corporate_CTYexposure')->nullable();
|
||||||
|
$table->jsonb('corporate_adverse')->nullable();
|
||||||
|
$table->jsonb('corporate_pep')->nullable();
|
||||||
|
$table->jsonb('corporate_adverse2')->nullable();
|
||||||
|
$table->jsonb('corporate_exportcontrol')->nullable();
|
||||||
|
$table->jsonb('corporate_mediamatch')->nullable();
|
||||||
|
$table->jsonb('corporate_haven')->nullable();
|
||||||
|
$table->jsonb('corporate_haven2')->nullable();
|
||||||
|
$table->jsonb('corporate_insiders')->nullable();
|
||||||
|
$table->jsonb('corporate_courtcases')->nullable();
|
||||||
|
$table->jsonb('corporate_manda')->nullable();
|
||||||
|
$table->jsonb('corporate_pepdetail')->nullable();
|
||||||
|
|
||||||
|
// Transaction Information
|
||||||
|
$table->jsonb('tranx_TX_AMOUNT')->nullable();
|
||||||
|
$table->jsonb('tranx_historical')->nullable();
|
||||||
|
$table->jsonb('tranx_TX_PURPOSE')->nullable();
|
||||||
|
$table->jsonb('tranx_counterpartyassessment')->nullable();
|
||||||
|
$table->jsonb('tranx_context')->nullable();
|
||||||
|
$table->jsonb('tranx_report')->nullable();
|
||||||
|
$table->jsonb('tranx_PURPOSEbase')->nullable();
|
||||||
|
$table->jsonb('tranx_performanceperiod')->nullable();
|
||||||
|
$table->jsonb('tranx_seasonality')->nullable();
|
||||||
|
$table->jsonb('tranx_resolution')->nullable();
|
||||||
|
$table->jsonb('trans_IBANvalidation')->nullable();
|
||||||
|
$table->jsonb('tranx_businesslogic')->nullable();
|
||||||
|
$table->jsonb('tranx_plausibilty')->nullable();
|
||||||
|
$table->jsonb('tranx_outliers')->nullable();
|
||||||
|
$table->jsonb('tranx_patterns')->nullable();
|
||||||
|
$table->jsonb('tranx_revenueimpact')->nullable();
|
||||||
|
$table->jsonb('tranx_profitimpact')->nullable();
|
||||||
|
$table->jsonb('tranx_marketimpact')->nullable();
|
||||||
|
$table->jsonb('tranx_duplicate')->nullable();
|
||||||
|
$table->jsonb('tranx_pattern2')->nullable();
|
||||||
|
$table->jsonb('tranx_contracttenor')->nullable();
|
||||||
|
$table->jsonb('tranx_mismatch')->nullable();
|
||||||
|
$table->jsonb('tranx_fakepurposecheck')->nullable();
|
||||||
|
$table->jsonb('tranx_structuring')->nullable();
|
||||||
|
$table->jsonb('tranx_newbankaccount')->nullable();
|
||||||
|
$table->jsonb('tranx_weekday')->nullable();
|
||||||
|
$table->jsonb('tranx_holdingobfuscation')->nullable();
|
||||||
|
$table->jsonb('tranx_score')->nullable();
|
||||||
|
$table->jsonb('tranx_reasoning')->nullable();
|
||||||
|
$table->jsonb('tranx_recommendation')->nullable();
|
||||||
|
$table->jsonb('tranx_sourcerepository')->nullable();
|
||||||
|
|
||||||
|
// Source Information
|
||||||
|
$table->jsonb('source_domaincheck')->nullable();
|
||||||
|
$table->jsonb('source_check')->nullable();
|
||||||
|
$table->jsonb('source_approveuniqueID')->nullable();
|
||||||
|
$table->jsonb('source_randomplausibility')->nullable();
|
||||||
|
|
||||||
|
// Risk Assessment
|
||||||
|
$table->jsonb('sanctions_circumvention')->nullable();
|
||||||
|
$table->jsonb('corruption_sector')->nullable();
|
||||||
|
$table->jsonb('corruption_country')->nullable();
|
||||||
|
$table->jsonb('corruption_relationship')->nullable();
|
||||||
|
$table->jsonb('country_risk')->nullable();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::table('transactions', function (Blueprint $table) {
|
||||||
|
$table->dropColumn([
|
||||||
|
// Corporate Information
|
||||||
|
'corporate_summary',
|
||||||
|
'corporate_history',
|
||||||
|
'corporate_purpose',
|
||||||
|
'corporate_sector',
|
||||||
|
'corporate_nace',
|
||||||
|
'corporate_products',
|
||||||
|
'corporate_markets',
|
||||||
|
'corporate_supply',
|
||||||
|
'corporate_name',
|
||||||
|
'corporate_form',
|
||||||
|
'corporate_forum',
|
||||||
|
'corporate_HQ',
|
||||||
|
'corporate_locations',
|
||||||
|
'corporate_holding',
|
||||||
|
'corporate_shareholders',
|
||||||
|
'corporate_board',
|
||||||
|
'corporate_supervisory',
|
||||||
|
'corporate_powerofattorney',
|
||||||
|
'corporate_taxID',
|
||||||
|
'corporate_LEI',
|
||||||
|
'corporate_UBO',
|
||||||
|
'corporate_employeecount',
|
||||||
|
'corporate_turnover',
|
||||||
|
'corporate_EBIT',
|
||||||
|
'corporate_netprofits',
|
||||||
|
'corporate_balancesheet',
|
||||||
|
'corporate_auditfindings',
|
||||||
|
'corporate_insolvency',
|
||||||
|
'corporate_liquidation',
|
||||||
|
'corporate_adhoc',
|
||||||
|
'corporate_pressrelease',
|
||||||
|
'corporate_votes',
|
||||||
|
'corporate_directordealings',
|
||||||
|
'corporate_brands',
|
||||||
|
'corporate_website',
|
||||||
|
'corporate_domain',
|
||||||
|
'corporate_IBAN',
|
||||||
|
'corporate_solvency',
|
||||||
|
'corporate_rating',
|
||||||
|
'corporate_ESG',
|
||||||
|
'corporate_license',
|
||||||
|
'corporate_warnings',
|
||||||
|
'corporate_eusanctions',
|
||||||
|
'corporate_ofacsanctions',
|
||||||
|
'corporate_uksanctions',
|
||||||
|
'corporate_pepexposure',
|
||||||
|
'corporate_adversemediascanning',
|
||||||
|
'corporate_corruptionexposure',
|
||||||
|
'corporate_AMLexposure',
|
||||||
|
'corporate_CTYexposure',
|
||||||
|
'corporate_adverse',
|
||||||
|
'corporate_pep',
|
||||||
|
'corporate_adverse2',
|
||||||
|
'corporate_exportcontrol',
|
||||||
|
'corporate_mediamatch',
|
||||||
|
'corporate_haven',
|
||||||
|
'corporate_haven2',
|
||||||
|
'corporate_insiders',
|
||||||
|
'corporate_courtcases',
|
||||||
|
'corporate_manda',
|
||||||
|
'corporate_pepdetail',
|
||||||
|
// Transaction Information
|
||||||
|
'tranx_TX_AMOUNT',
|
||||||
|
'tranx_historical',
|
||||||
|
'tranx_TX_PURPOSE',
|
||||||
|
'tranx_counterpartyassessment',
|
||||||
|
'tranx_context',
|
||||||
|
'tranx_report',
|
||||||
|
'tranx_PURPOSEbase',
|
||||||
|
'tranx_performanceperiod',
|
||||||
|
'tranx_seasonality',
|
||||||
|
'tranx_resolution',
|
||||||
|
'trans_IBANvalidation',
|
||||||
|
'tranx_businesslogic',
|
||||||
|
'tranx_plausibilty',
|
||||||
|
'tranx_outliers',
|
||||||
|
'tranx_patterns',
|
||||||
|
'tranx_revenueimpact',
|
||||||
|
'tranx_profitimpact',
|
||||||
|
'tranx_marketimpact',
|
||||||
|
'tranx_duplicate',
|
||||||
|
'tranx_pattern2',
|
||||||
|
'tranx_contracttenor',
|
||||||
|
'tranx_mismatch',
|
||||||
|
'tranx_fakepurposecheck',
|
||||||
|
'tranx_structuring',
|
||||||
|
'tranx_newbankaccount',
|
||||||
|
'tranx_weekday',
|
||||||
|
'tranx_holdingobfuscation',
|
||||||
|
'tranx_score',
|
||||||
|
'tranx_reasoning',
|
||||||
|
'tranx_recommendation',
|
||||||
|
'tranx_sourcerepository',
|
||||||
|
// Source Information
|
||||||
|
'source_domaincheck',
|
||||||
|
'source_check',
|
||||||
|
'source_approveuniqueID',
|
||||||
|
'source_randomplausibility',
|
||||||
|
// Risk Assessment
|
||||||
|
'sanctions_circumvention',
|
||||||
|
'corruption_sector',
|
||||||
|
'corruption_country',
|
||||||
|
'corruption_relationship',
|
||||||
|
'country_risk',
|
||||||
|
]);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,102 @@
|
|||||||
|
"output_key"
|
||||||
|
"corporate_summary"
|
||||||
|
"corporate_history"
|
||||||
|
"corporate_purpose"
|
||||||
|
"corporate_sector"
|
||||||
|
"corporate_nace"
|
||||||
|
"corporate_products"
|
||||||
|
"corporate_markets"
|
||||||
|
"corporate_supply"
|
||||||
|
"corporate_name"
|
||||||
|
"corporate_form"
|
||||||
|
"corporate_forum"
|
||||||
|
"corporate_HQ"
|
||||||
|
"corporate_locations"
|
||||||
|
"corporate_holding"
|
||||||
|
"corporate_shareholders"
|
||||||
|
"corporate_board"
|
||||||
|
"corporate_supervisory"
|
||||||
|
"corporate_powerofattorney"
|
||||||
|
"corporate_taxID"
|
||||||
|
"corporate_LEI"
|
||||||
|
"corporate_UBO"
|
||||||
|
"corporate_employeecount"
|
||||||
|
"corporate_turnover"
|
||||||
|
"corporate_EBIT"
|
||||||
|
"corporate_netprofits"
|
||||||
|
"corporate_balancesheet"
|
||||||
|
"corporate_auditfindings"
|
||||||
|
"corporate_insolvency"
|
||||||
|
"corporate_liquidation"
|
||||||
|
"corporate_adhoc"
|
||||||
|
"corporate_pressrelease"
|
||||||
|
"corporate_votes"
|
||||||
|
"corporate_directordealings"
|
||||||
|
"corporate_brands"
|
||||||
|
"corporate_website"
|
||||||
|
"corporate_domain"
|
||||||
|
"corporate_IBAN"
|
||||||
|
"corporate_solvency"
|
||||||
|
"corporate_rating"
|
||||||
|
"corporate_ESG"
|
||||||
|
"corporate_license"
|
||||||
|
"corporate_warnings"
|
||||||
|
"corporate_eusanctions"
|
||||||
|
"corporate_ofacsanctions"
|
||||||
|
"corporate_uksanctions"
|
||||||
|
"corporate_pepexposure"
|
||||||
|
"corporate_adversemediascanning"
|
||||||
|
"corporate_corruptionexposure"
|
||||||
|
"corporate_AMLexposure"
|
||||||
|
"corporate_CTYexposure"
|
||||||
|
"tranx_TX_AMOUNT"
|
||||||
|
"tranx_historical"
|
||||||
|
"tranx_TX_PURPOSE"
|
||||||
|
"tranx_counterpartyassessment"
|
||||||
|
"tranx_context"
|
||||||
|
"tranx_report"
|
||||||
|
"tranx_PURPOSEbase"
|
||||||
|
"tranx_performanceperiod"
|
||||||
|
"tranx_seasonality"
|
||||||
|
"tranx_resolution"
|
||||||
|
"trans_IBANvalidation"
|
||||||
|
"tranx_businesslogic"
|
||||||
|
"source_domaincheck"
|
||||||
|
"tranx_plausibilty"
|
||||||
|
"tranx_outliers"
|
||||||
|
"tranx_patterns"
|
||||||
|
"tranx_revenueimpact"
|
||||||
|
"tranx_profitimpact"
|
||||||
|
"tranx_marketimpact"
|
||||||
|
"source_check"
|
||||||
|
"source_approveuniqueID"
|
||||||
|
"sanctions_circumvention"
|
||||||
|
"corruption_sector"
|
||||||
|
"corruption_country"
|
||||||
|
"corruption_relationship"
|
||||||
|
"corporate_adverse"
|
||||||
|
"corporate_pep"
|
||||||
|
"corporate_adverse2"
|
||||||
|
"tranx_duplicate"
|
||||||
|
"tranx_pattern2"
|
||||||
|
"corporate_exportcontrol"
|
||||||
|
"corporate_mediamatch"
|
||||||
|
"tranx_contracttenor"
|
||||||
|
"corporate_haven"
|
||||||
|
"tranx_mismatch"
|
||||||
|
"country_risk"
|
||||||
|
"corporate_haven2"
|
||||||
|
"corporate_insiders"
|
||||||
|
"corporate_courtcases"
|
||||||
|
"corporate_manda"
|
||||||
|
"tranx_fakepurposecheck"
|
||||||
|
"tranx_structuring"
|
||||||
|
"tranx_newbankaccount"
|
||||||
|
"corporate_pepdetail"
|
||||||
|
"tranx_weekday"
|
||||||
|
"tranx_holdingobfuscation"
|
||||||
|
"source_randomplausibility"
|
||||||
|
"tranx_score"
|
||||||
|
"tranx_reasoning"
|
||||||
|
"tranx_recommendation"
|
||||||
|
"tranx_sourcerepository"
|
||||||
|
File diff suppressed because one or more lines are too long
@@ -0,0 +1,51 @@
|
|||||||
|
Select * from
|
||||||
|
backend2.transactions as t
|
||||||
|
left join backend2.transaction_outputs as tout on t.id = tout.transaction_id
|
||||||
|
--where t.id = 1 and tout.prompt_id = 98
|
||||||
|
--where t.created_at like '2025-11-12%' and tout.prompt_id = 98
|
||||||
|
order by transaction_id, prompt_id;
|
||||||
|
|
||||||
|
|
||||||
|
select * from public.transactions
|
||||||
|
order by "requires_review" desc, "risk_score" desc, "executed_at" desc
|
||||||
|
limit 12 offset 0;
|
||||||
|
|
||||||
|
|
||||||
|
SELECT * FROM information_schema.columns
|
||||||
|
WHERE table_schema = 'public' and table_name = 'transactions';
|
||||||
|
|
||||||
|
/* Abfrage von Werten in JSONB */
|
||||||
|
select content_json->'answer' as answer , content_json->
|
||||||
|
from public.transaction_outputs
|
||||||
|
where transaction_id = 2 --and prompt_id = 2
|
||||||
|
order by transaction_id, prompt_id;
|
||||||
|
|
||||||
|
|
||||||
|
-- Einer von mehreren Keys existiert?
|
||||||
|
SELECT * FROM public.transaction_outputs
|
||||||
|
WHERE content_json ?| array['risk_score', 'risk_level', 'risk_details_json'];
|
||||||
|
|
||||||
|
select * from backend2.transaction_outputs;
|
||||||
|
|
||||||
|
|
||||||
|
/* Kopieren einer Tabelle von einem Schema in ein neues Schema */
|
||||||
|
CREATE TABLE public.transaction_outputs AS
|
||||||
|
SELECT * FROM backend.transaction_outputs;
|
||||||
|
/* Prüfen ob alle Daten valides Json sind*/
|
||||||
|
SELECT content from public.transaction_outputs
|
||||||
|
WHERE content IS NOT NULL
|
||||||
|
AND content::jsonb IS NULL;
|
||||||
|
/* Neue Spalte zur kopierten Tabelle hinzufügen*/
|
||||||
|
ALTER TABLE public.transaction_outputs
|
||||||
|
ADD COLUMN content_json jsonb;
|
||||||
|
/* Kopieren der String Daten in die JSONB Spalte*/
|
||||||
|
UPDATE public.transaction_outputs
|
||||||
|
SET content_json = content::jsonb
|
||||||
|
WHERE content IS NOT NULL;
|
||||||
|
/* Index erstellen*/
|
||||||
|
CREATE INDEX idx_content_json ON public.transaction_outputs USING gin(content_json);
|
||||||
|
CREATE INDEX idx_data_gin ON tablename USING gin(data);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user