Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import frappe
- # tables that should have rows
- res_production = [{'database_name': 'production',
- 'table_name': 'tabAccess Log',
- 'table_rows': 21914},
- {'database_name': 'production',
- 'table_name': 'tabAccount',
- 'table_rows': 2836},
- {'database_name': 'production',
- 'table_name': 'tabAccounting Dimension',
- 'table_rows': 1},
- {'database_name': 'production',
- 'table_name': 'tabAccounting Dimension Detail',
- 'table_rows': 1},
- {'database_name': 'production',
- 'table_name': 'tabActivity Log',
- 'table_rows': 124867},
- {'database_name': 'production',
- 'table_name': 'tabAddress',
- 'table_rows': 12715},
- {'database_name': 'production',
- 'table_name': 'tabAddress Template',
- 'table_rows': 2},
- {'database_name': 'production',
- 'table_name': 'tabAppraisal',
- 'table_rows': 37},
- {'database_name': 'production',
- 'table_name': 'tabAppraisal Goal',
- 'table_rows': 326},
- {'database_name': 'production',
- 'table_name': 'tabAppraisal Template',
- 'table_rows': 16},
- {'database_name': 'production',
- 'table_name': 'tabAppraisal Template Goal',
- 'table_rows': 119},
- {'database_name': 'production', 'table_name': 'tabAsset', 'table_rows': 2},
- {'database_name': 'production',
- 'table_name': 'tabAsset Category',
- 'table_rows': 6},
- {'database_name': 'production',
- 'table_name': 'tabAsset Category Account',
- 'table_rows': 6},
- {'database_name': 'production',
- 'table_name': 'tabAsset Finance Book',
- 'table_rows': 13},
- {'database_name': 'production',
- 'table_name': 'tabAsset Movement',
- 'table_rows': 1},
- {'database_name': 'production',
- 'table_name': 'tabAsset Movement Item',
- 'table_rows': 1},
- {'database_name': 'production',
- 'table_name': 'tabAttendance',
- 'table_rows': 1768},
- {'database_name': 'production', 'table_name': 'tabBank', 'table_rows': 2},
- {'database_name': 'production',
- 'table_name': 'tabBank Account',
- 'table_rows': 3},
- {'database_name': 'production', 'table_name': 'tabBatch', 'table_rows': 2},
- {'database_name': 'production', 'table_name': 'tabBin', 'table_rows': 4743},
- {'database_name': 'production', 'table_name': 'tabBOM', 'table_rows': 544},
- {'database_name': 'production',
- 'table_name': 'tabBOM Explosion Item',
- 'table_rows': 3334},
- {'database_name': 'production',
- 'table_name': 'tabBOM Item',
- 'table_rows': 3104},
- {'database_name': 'production', 'table_name': 'tabBranch', 'table_rows': 38},
- {'database_name': 'production', 'table_name': 'tabBrand', 'table_rows': 11},
- {'database_name': 'production', 'table_name': 'tabBudget', 'table_rows': 1},
- {'database_name': 'production',
- 'table_name': 'tabBudget Account',
- 'table_rows': 2},
- {'database_name': 'production', 'table_name': 'tabCampaign', 'table_rows': 2},
- {'database_name': 'production',
- 'table_name': 'tabCash Flow Mapper',
- 'table_rows': 3},
- {'database_name': 'production',
- 'table_name': 'tabChat Message',
- 'table_rows': 2},
- {'database_name': 'production',
- 'table_name': 'tabChat Profile',
- 'table_rows': 54},
- {'database_name': 'production',
- 'table_name': 'tabChat Room',
- 'table_rows': 3},
- {'database_name': 'production',
- 'table_name': 'tabChat Room User',
- 'table_rows': 3},
- {'database_name': 'production',
- 'table_name': 'tabComment',
- 'table_rows': 62353},
- {'database_name': 'production',
- 'table_name': 'tabCommunication',
- 'table_rows': 21},
- {'database_name': 'production',
- 'table_name': 'tabCommunication Link',
- 'table_rows': 5},
- {'database_name': 'production', 'table_name': 'tabCompany', 'table_rows': 3},
- {'database_name': 'production',
- 'table_name': 'tabContact',
- 'table_rows': 14322},
- {'database_name': 'production',
- 'table_name': 'tabContact Email',
- 'table_rows': 2249},
- {'database_name': 'production',
- 'table_name': 'tabContact Phone',
- 'table_rows': 13872},
- {'database_name': 'production',
- 'table_name': 'tabContainer',
- 'table_rows': 3},
- {'database_name': 'production',
- 'table_name': 'tabCost Center',
- 'table_rows': 63},
- {'database_name': 'production',
- 'table_name': 'tabCountry',
- 'table_rows': 250},
- {'database_name': 'production',
- 'table_name': 'tabCurrency',
- 'table_rows': 149},
- {'database_name': 'production',
- 'table_name': 'tabCurrency Exchange',
- 'table_rows': 7},
- {'database_name': 'production',
- 'table_name': 'tabCustom DocPerm',
- 'table_rows': 275},
- {'database_name': 'production',
- 'table_name': 'tabCustom Field',
- 'table_rows': 162},
- {'database_name': 'production',
- 'table_name': 'tabCustom Script',
- 'table_rows': 1},
- {'database_name': 'production',
- 'table_name': 'tabCustomer',
- 'table_rows': 29080},
- {'database_name': 'production',
- 'table_name': 'tabCustomer Credit Limit',
- 'table_rows': 12},
- {'database_name': 'production',
- 'table_name': 'tabCustomer Group',
- 'table_rows': 18},
- {'database_name': 'production',
- 'table_name': 'tabDashboard',
- 'table_rows': 1},
- {'database_name': 'production',
- 'table_name': 'tabDashboard Chart',
- 'table_rows': 3},
- {'database_name': 'production',
- 'table_name': 'tabDashboard Chart Link',
- 'table_rows': 2},
- {'database_name': 'production',
- 'table_name': 'tabData Import',
- 'table_rows': 5},
- {'database_name': 'production',
- 'table_name': 'tabData Import Legacy',
- 'table_rows': 6},
- {'database_name': 'production',
- 'table_name': 'tabData Migration Mapping',
- 'table_rows': 5},
- {'database_name': 'production',
- 'table_name': 'tabData Migration Mapping Detail',
- 'table_rows': 21},
- {'database_name': 'production',
- 'table_name': 'tabData Migration Plan',
- 'table_rows': 2},
- {'database_name': 'production',
- 'table_name': 'tabData Migration Plan Mapping',
- 'table_rows': 3},
- {'database_name': 'production',
- 'table_name': 'tabDefaultValue',
- 'table_rows': 67},
- {'database_name': 'production',
- 'table_name': 'tabDeleted Document',
- 'table_rows': 11863},
- {'database_name': 'production',
- 'table_name': 'tabDelivery Driver',
- 'table_rows': 10},
- {'database_name': 'production',
- 'table_name': 'tabDelivery Note',
- 'table_rows': 607},
- {'database_name': 'production',
- 'table_name': 'tabDelivery Note Item',
- 'table_rows': 1026},
- {'database_name': 'production',
- 'table_name': 'tabDelivery Return Reason',
- 'table_rows': 2},
- {'database_name': 'production',
- 'table_name': 'tabDelivery Sector',
- 'table_rows': 123},
- {'database_name': 'production',
- 'table_name': 'tabDelivery Stop',
- 'table_rows': 609},
- {'database_name': 'production',
- 'table_name': 'tabDelivery Trip',
- 'table_rows': 533},
- {'database_name': 'production',
- 'table_name': 'tabDepartment',
- 'table_rows': 40},
- {'database_name': 'production',
- 'table_name': 'tabDepreciation Schedule',
- 'table_rows': 180},
- {'database_name': 'production',
- 'table_name': 'tabDesignation',
- 'table_rows': 77},
- {'database_name': 'production',
- 'table_name': 'tabDocField',
- 'table_rows': 11507},
- {'database_name': 'production',
- 'table_name': 'tabDocPerm',
- 'table_rows': 1157},
- {'database_name': 'production',
- 'table_name': 'tabDocShare',
- 'table_rows': 185},
- {'database_name': 'production',
- 'table_name': 'tabDocType',
- 'table_rows': 909},
- {'database_name': 'production',
- 'table_name': 'tabDocument Follow',
- 'table_rows': 4883},
- {'database_name': 'production', 'table_name': 'tabDomain', 'table_rows': 7},
- {'database_name': 'production', 'table_name': 'tabDriver', 'table_rows': 10},
- {'database_name': 'production',
- 'table_name': 'tabDynamic Link',
- 'table_rows': 27815},
- {'database_name': 'production',
- 'table_name': 'tabEmail Account',
- 'table_rows': 3},
- {'database_name': 'production',
- 'table_name': 'tabEmail Domain',
- 'table_rows': 2},
- {'database_name': 'production',
- 'table_name': 'tabEmail Queue',
- 'table_rows': 18217},
- {'database_name': 'production',
- 'table_name': 'tabEmail Queue Recipient',
- 'table_rows': 30360},
- {'database_name': 'production',
- 'table_name': 'tabEmail Unsubscribe',
- 'table_rows': 2},
- {'database_name': 'production',
- 'table_name': 'tabEmployee',
- 'table_rows': 287},
- {'database_name': 'production',
- 'table_name': 'tabEmployee Checkin',
- 'table_rows': 181},
- {'database_name': 'production',
- 'table_name': 'tabEmployee Education',
- 'table_rows': 313},
- {'database_name': 'production',
- 'table_name': 'tabEmployee External Work History',
- 'table_rows': 91},
- {'database_name': 'production',
- 'table_name': 'tabEmployee Grade',
- 'table_rows': 2},
- {'database_name': 'production',
- 'table_name': 'tabEmployee Health Insurance',
- 'table_rows': 8},
- {'database_name': 'production',
- 'table_name': 'tabEmployee Internal Work History',
- 'table_rows': 496},
- {'database_name': 'production',
- 'table_name': 'tabEmployee Property History',
- 'table_rows': 7},
- {'database_name': 'production',
- 'table_name': 'tabEmployee Transfer',
- 'table_rows': 7},
- {'database_name': 'production',
- 'table_name': 'tabEmployee Warehouse',
- 'table_rows': 64},
- {'database_name': 'production',
- 'table_name': 'tabEmployment Type',
- 'table_rows': 11},
- {'database_name': 'production',
- 'table_name': 'tabEnergy Point Log',
- 'table_rows': 24824},
- {'database_name': 'production',
- 'table_name': 'tabEnergy Point Rule',
- 'table_rows': 8},
- {'database_name': 'production',
- 'table_name': 'tabError Log',
- 'table_rows': 12742},
- {'database_name': 'production',
- 'table_name': 'tabError Snapshot',
- 'table_rows': 74},
- {'database_name': 'production', 'table_name': 'tabEvent', 'table_rows': 5},
- {'database_name': 'production',
- 'table_name': 'tabEvent Participants',
- 'table_rows': 5},
- {'database_name': 'production', 'table_name': 'tabFile', 'table_rows': 3295},
- {'database_name': 'production',
- 'table_name': 'tabFinance Book',
- 'table_rows': 2},
- {'database_name': 'production',
- 'table_name': 'tabFiscal Year',
- 'table_rows': 5},
- {'database_name': 'production',
- 'table_name': 'tabFiscal Year Company',
- 'table_rows': 2},
- {'database_name': 'production', 'table_name': 'tabGender', 'table_rows': 10},
- {'database_name': 'production',
- 'table_name': 'tabGeneric',
- 'table_rows': 890},
- {'database_name': 'production',
- 'table_name': 'tabGL Entry',
- 'table_rows': 7322067},
- {'database_name': 'production',
- 'table_name': 'tabGlobal Search DocType',
- 'table_rows': 61},
- {'database_name': 'production',
- 'table_name': 'tabHas Role',
- 'table_rows': 2590},
- {'database_name': 'production', 'table_name': 'tabHoliday', 'table_rows': 37},
- {'database_name': 'production',
- 'table_name': 'tabHoliday List',
- 'table_rows': 6},
- {'database_name': 'production',
- 'table_name': 'tabIncome Tax Slab',
- 'table_rows': 1},
- {'database_name': 'production',
- 'table_name': 'tabIncome Tax Slab Other Charges',
- 'table_rows': 2},
- {'database_name': 'production',
- 'table_name': 'tabInstalled Application',
- 'table_rows': 11},
- {'database_name': 'production', 'table_name': 'tabIssue', 'table_rows': 431},
- {'database_name': 'production',
- 'table_name': 'tabIssue Priority',
- 'table_rows': 6},
- {'database_name': 'production',
- 'table_name': 'tabIssue Type',
- 'table_rows': 130},
- {'database_name': 'production', 'table_name': 'tabItem', 'table_rows': 2314},
- {'database_name': 'production',
- 'table_name': 'tabItem Barcode',
- 'table_rows': 12},
- {'database_name': 'production',
- 'table_name': 'tabItem Customer Detail',
- 'table_rows': 2},
- {'database_name': 'production',
- 'table_name': 'tabItem Default',
- 'table_rows': 772},
- {'database_name': 'production',
- 'table_name': 'tabItem Group',
- 'table_rows': 444},
- {'database_name': 'production',
- 'table_name': 'tabItem Price',
- 'table_rows': 1658},
- {'database_name': 'production',
- 'table_name': 'tabItem Quality Inspection Parameter',
- 'table_rows': 3},
- {'database_name': 'production',
- 'table_name': 'tabItem Supplier',
- 'table_rows': 141},
- {'database_name': 'production',
- 'table_name': 'tabItem Tax Template',
- 'table_rows': 2},
- {'database_name': 'production',
- 'table_name': 'tabItem Tax Template Detail',
- 'table_rows': 3},
- {'database_name': 'production',
- 'table_name': 'tabJob Applicant',
- 'table_rows': 217},
- {'database_name': 'production',
- 'table_name': 'tabJob Applicant Source',
- 'table_rows': 8},
- {'database_name': 'production',
- 'table_name': 'tabJob Opening',
- 'table_rows': 16},
- {'database_name': 'production',
- 'table_name': 'tabJournal Entry',
- 'table_rows': 1400},
- {'database_name': 'production',
- 'table_name': 'tabJournal Entry Account',
- 'table_rows': 4232},
- {'database_name': 'production',
- 'table_name': 'tabKanban Board',
- 'table_rows': 2},
- {'database_name': 'production',
- 'table_name': 'tabKanban Board Column',
- 'table_rows': 14},
- {'database_name': 'production',
- 'table_name': 'tabLanded Cost Item',
- 'table_rows': 516},
- {'database_name': 'production',
- 'table_name': 'tabLanded Cost Purchase Receipt',
- 'table_rows': 57},
- {'database_name': 'production',
- 'table_name': 'tabLanded Cost Taxes and Charges',
- 'table_rows': 275},
- {'database_name': 'production',
- 'table_name': 'tabLanded Cost Voucher',
- 'table_rows': 31},
- {'database_name': 'production',
- 'table_name': 'tabLanguage',
- 'table_rows': 80},
- {'database_name': 'production', 'table_name': 'tabLead', 'table_rows': 6},
- {'database_name': 'production',
- 'table_name': 'tabLead Source',
- 'table_rows': 5},
- {'database_name': 'production',
- 'table_name': 'tabLeave Allocation',
- 'table_rows': 260},
- {'database_name': 'production',
- 'table_name': 'tabLeave Application',
- 'table_rows': 94},
- {'database_name': 'production',
- 'table_name': 'tabLeave Ledger Entry',
- 'table_rows': 531},
- {'database_name': 'production',
- 'table_name': 'tabLeave Policy Detail',
- 'table_rows': 2},
- {'database_name': 'production',
- 'table_name': 'tabLeave Type',
- 'table_rows': 27},
- {'database_name': 'production',
- 'table_name': 'tabLetter Head',
- 'table_rows': 1},
- {'database_name': 'production',
- 'table_name': 'tabLoading Conversion Detail',
- 'table_rows': 134},
- {'database_name': 'production',
- 'table_name': 'tabLocation',
- 'table_rows': 14},
- {'database_name': 'production',
- 'table_name': 'tabMardom Endpoint',
- 'table_rows': 2},
- {'database_name': 'production',
- 'table_name': 'tabMarket Segment',
- 'table_rows': 3},
- {'database_name': 'production',
- 'table_name': 'tabMaterial Request',
- 'table_rows': 4953},
- {'database_name': 'production',
- 'table_name': 'tabMaterial Request Item',
- 'table_rows': 28013},
- {'database_name': 'production',
- 'table_name': 'tabMaterial Request Plan Item',
- 'table_rows': 8},
- {'database_name': 'production',
- 'table_name': 'tabMobile Assignement',
- 'table_rows': 3},
- {'database_name': 'production',
- 'table_name': 'tabMobile Assignment',
- 'table_rows': 10},
- {'database_name': 'production',
- 'table_name': 'tabMode of Payment',
- 'table_rows': 18},
- {'database_name': 'production',
- 'table_name': 'tabMode of Payment Account',
- 'table_rows': 21},
- {'database_name': 'production',
- 'table_name': 'tabModule Def',
- 'table_rows': 47},
- {'database_name': 'production',
- 'table_name': 'tabMonthly Distribution',
- 'table_rows': 2},
- {'database_name': 'production',
- 'table_name': 'tabMonthly Distribution Percentage',
- 'table_rows': 24},
- {'database_name': 'production',
- 'table_name': 'tabNCF Chart',
- 'table_rows': 5},
- {'database_name': 'production',
- 'table_name': 'tabNCF Manager Log',
- 'table_rows': 485},
- {'database_name': 'production',
- 'table_name': 'tabNotification',
- 'table_rows': 5},
- {'database_name': 'production',
- 'table_name': 'tabNotification Log',
- 'table_rows': 25761},
- {'database_name': 'production',
- 'table_name': 'tabNotification Recipient',
- 'table_rows': 6},
- {'database_name': 'production',
- 'table_name': 'tabNotification Settings',
- 'table_rows': 50},
- {'database_name': 'production',
- 'table_name': 'tabOAuth Authorization Code',
- 'table_rows': 7},
- {'database_name': 'production',
- 'table_name': 'tabOAuth Bearer Token',
- 'table_rows': 73},
- {'database_name': 'production',
- 'table_name': 'tabOAuth Client',
- 'table_rows': 1},
- {'database_name': 'production',
- 'table_name': 'tabOpening Invoice Creation Tool Item',
- 'table_rows': 2},
- {'database_name': 'production',
- 'table_name': 'tabOpportunity',
- 'table_rows': 2},
- {'database_name': 'production',
- 'table_name': 'tabPacked Item',
- 'table_rows': 6730894},
- {'database_name': 'production', 'table_name': 'tabPage', 'table_rows': 21},
- {'database_name': 'production',
- 'table_name': 'tabParty Account',
- 'table_rows': 69},
- {'database_name': 'production',
- 'table_name': 'tabParty Type',
- 'table_rows': 6},
- {'database_name': 'production',
- 'table_name': 'tabPatch Log',
- 'table_rows': 939},
- {'database_name': 'production',
- 'table_name': 'tabPayment Entry',
- 'table_rows': 59},
- {'database_name': 'production',
- 'table_name': 'tabPayment Entry Reference',
- 'table_rows': 2191},
- {'database_name': 'production',
- 'table_name': 'tabPayment Schedule',
- 'table_rows': 108763},
- {'database_name': 'production',
- 'table_name': 'tabPayment Term',
- 'table_rows': 19},
- {'database_name': 'production',
- 'table_name': 'tabPayment Terms Template',
- 'table_rows': 20},
- {'database_name': 'production',
- 'table_name': 'tabPayment Terms Template Detail',
- 'table_rows': 21},
- {'database_name': 'production',
- 'table_name': 'tabPortal Menu Item',
- 'table_rows': 22},
- {'database_name': 'production',
- 'table_name': 'tabPrepared Report',
- 'table_rows': 1470},
- {'database_name': 'production',
- 'table_name': 'tabPrice List',
- 'table_rows': 18},
- {'database_name': 'production',
- 'table_name': 'tabPrice List Country',
- 'table_rows': 9},
- {'database_name': 'production',
- 'table_name': 'tabPricing Rule',
- 'table_rows': 27},
- {'database_name': 'production',
- 'table_name': 'tabPricing Rule Item Group',
- 'table_rows': 38},
- {'database_name': 'production',
- 'table_name': 'tabPrint Format',
- 'table_rows': 49},
- {'database_name': 'production',
- 'table_name': 'tabPrint Style',
- 'table_rows': 3},
- {'database_name': 'production',
- 'table_name': 'tabProduct Bundle',
- 'table_rows': 510},
- {'database_name': 'production',
- 'table_name': 'tabProduct Bundle Item',
- 'table_rows': 1793},
- {'database_name': 'production',
- 'table_name': 'tabProduction Plan',
- 'table_rows': 537},
- {'database_name': 'production',
- 'table_name': 'tabProduction Plan Item',
- 'table_rows': 2600},
- {'database_name': 'production',
- 'table_name': 'tabProduction Plan Material Request',
- 'table_rows': 557},
- {'database_name': 'production',
- 'table_name': 'tabProduction Plan Sales Order',
- 'table_rows': 5},
- {'database_name': 'production', 'table_name': 'tabProject', 'table_rows': 12},
- {'database_name': 'production',
- 'table_name': 'tabProject Template',
- 'table_rows': 3},
- {'database_name': 'production',
- 'table_name': 'tabProject Template Task',
- 'table_rows': 4},
- {'database_name': 'production',
- 'table_name': 'tabProject Type',
- 'table_rows': 3},
- {'database_name': 'production',
- 'table_name': 'tabProperty Setter',
- 'table_rows': 154},
- {'database_name': 'production',
- 'table_name': 'tabPurchase Estimation',
- 'table_rows': 10},
- {'database_name': 'production',
- 'table_name': 'tabPurchase Estimation Item',
- 'table_rows': 162},
- {'database_name': 'production',
- 'table_name': 'tabPurchase Estimation Template',
- 'table_rows': 8},
- {'database_name': 'production',
- 'table_name': 'tabPurchase Estimation Template Item',
- 'table_rows': 196},
- {'database_name': 'production',
- 'table_name': 'tabPurchase Invoice',
- 'table_rows': 1747},
- {'database_name': 'production',
- 'table_name': 'tabPurchase Invoice Item',
- 'table_rows': 2773},
- {'database_name': 'production',
- 'table_name': 'tabPurchase Order',
- 'table_rows': 419},
- {'database_name': 'production',
- 'table_name': 'tabPurchase Order Item',
- 'table_rows': 1643},
- {'database_name': 'production',
- 'table_name': 'tabPurchase Receipt',
- 'table_rows': 441},
- {'database_name': 'production',
- 'table_name': 'tabPurchase Receipt Item',
- 'table_rows': 1382},
- {'database_name': 'production',
- 'table_name': 'tabPurchase Taxes and Charges',
- 'table_rows': 2099},
- {'database_name': 'production',
- 'table_name': 'tabPurchase Taxes and Charges Template',
- 'table_rows': 8},
- {'database_name': 'production',
- 'table_name': 'tabQuotation',
- 'table_rows': 46},
- {'database_name': 'production',
- 'table_name': 'tabQuotation Item',
- 'table_rows': 147},
- {'database_name': 'production', 'table_name': 'tabReport', 'table_rows': 191},
- {'database_name': 'production',
- 'table_name': 'tabRetirement Insurer',
- 'table_rows': 4},
- {'database_name': 'production', 'table_name': 'tabRole', 'table_rows': 74},
- {'database_name': 'production',
- 'table_name': 'tabRole Profile',
- 'table_rows': 14},
- {'database_name': 'production',
- 'table_name': 'tabRoute History',
- 'table_rows': 204868},
- {'database_name': 'production',
- 'table_name': 'tabSalary Component',
- 'table_rows': 8},
- {'database_name': 'production',
- 'table_name': 'tabSalary Detail',
- 'table_rows': 208},
- {'database_name': 'production',
- 'table_name': 'tabSalary Slip',
- 'table_rows': 2},
- {'database_name': 'production',
- 'table_name': 'tabSales Invoice',
- 'table_rows': 1232968},
- {'database_name': 'production',
- 'table_name': 'tabSales Invoice Item',
- 'table_rows': 3060465},
- {'database_name': 'production',
- 'table_name': 'tabSales Invoice Payment',
- 'table_rows': 1471515},
- {'database_name': 'production',
- 'table_name': 'tabSales Order',
- 'table_rows': 15465},
- {'database_name': 'production',
- 'table_name': 'tabSales Order Item',
- 'table_rows': 28371},
- {'database_name': 'production',
- 'table_name': 'tabSales Partner',
- 'table_rows': 1},
- {'database_name': 'production',
- 'table_name': 'tabSales Scrap Entry',
- 'table_rows': 609},
- {'database_name': 'production',
- 'table_name': 'tabSales Scrap Entry Item',
- 'table_rows': 1288},
- {'database_name': 'production',
- 'table_name': 'tabSales Scrap Entry Reason',
- 'table_rows': 13},
- {'database_name': 'production',
- 'table_name': 'tabSales Taxes and Charges',
- 'table_rows': 3551440},
- {'database_name': 'production',
- 'table_name': 'tabSales Taxes and Charges Template',
- 'table_rows': 6},
- {'database_name': 'production',
- 'table_name': 'tabSalutation',
- 'table_rows': 9},
- {'database_name': 'production', 'table_name': 'tabSeries', 'table_rows': 208},
- {'database_name': 'production',
- 'table_name': 'tabSessions',
- 'table_rows': 29},
- {'database_name': 'production',
- 'table_name': 'tabShareholder',
- 'table_rows': 2},
- {'database_name': 'production',
- 'table_name': 'tabShift Type',
- 'table_rows': 4},
- {'database_name': 'production',
- 'table_name': 'tabShipping Rule',
- 'table_rows': 2},
- {'database_name': 'production',
- 'table_name': 'tabSingles',
- 'table_rows': 1538},
- {'database_name': 'production', 'table_name': 'tabSkill', 'table_rows': 2},
- {'database_name': 'production',
- 'table_name': 'tabSocial Login Key',
- 'table_rows': 1},
- {'database_name': 'production',
- 'table_name': 'tabStock Availability',
- 'table_rows': 10},
- {'database_name': 'production',
- 'table_name': 'tabStock Availability Item',
- 'table_rows': 1093},
- {'database_name': 'production',
- 'table_name': 'tabStock Entry',
- 'table_rows': 12897},
- {'database_name': 'production',
- 'table_name': 'tabStock Entry Detail',
- 'table_rows': 70495},
- {'database_name': 'production',
- 'table_name': 'tabStock Entry Type',
- 'table_rows': 9},
- {'database_name': 'production',
- 'table_name': 'tabStock Ledger Entry',
- 'table_rows': 251159},
- {'database_name': 'production',
- 'table_name': 'tabStock Reconciliation',
- 'table_rows': 481},
- {'database_name': 'production',
- 'table_name': 'tabStock Reconciliation Item',
- 'table_rows': 4260},
- {'database_name': 'production',
- 'table_name': 'tabStock Take',
- 'table_rows': 4441},
- {'database_name': 'production',
- 'table_name': 'tabStock Take Difference',
- 'table_rows': 250605},
- {'database_name': 'production',
- 'table_name': 'tabStock Take Item',
- 'table_rows': 289349},
- {'database_name': 'production',
- 'table_name': 'tabStock Take Purpose',
- 'table_rows': 6},
- {'database_name': 'production',
- 'table_name': 'tabStock Take Purpose Item',
- 'table_rows': 293},
- {'database_name': 'production',
- 'table_name': 'tabStock Take Template',
- 'table_rows': 6},
- {'database_name': 'production',
- 'table_name': 'tabStock Take Template Item',
- 'table_rows': 258},
- {'database_name': 'production',
- 'table_name': 'tabStock Take Type',
- 'table_rows': 3},
- {'database_name': 'production',
- 'table_name': 'tabStock Take UOM',
- 'table_rows': 1497},
- {'database_name': 'production',
- 'table_name': 'tabSuccess Action',
- 'table_rows': 6},
- {'database_name': 'production',
- 'table_name': 'tabSupplier',
- 'table_rows': 342},
- {'database_name': 'production',
- 'table_name': 'tabSupplier Group',
- 'table_rows': 15},
- {'database_name': 'production',
- 'table_name': 'tabSupply Ledger Entry',
- 'table_rows': 6753742},
- {'database_name': 'production', 'table_name': 'tabTag', 'table_rows': 2},
- {'database_name': 'production', 'table_name': 'tabTag Link', 'table_rows': 2},
- {'database_name': 'production', 'table_name': 'tabTask', 'table_rows': 136},
- {'database_name': 'production',
- 'table_name': 'tabTask Depends On',
- 'table_rows': 81},
- {'database_name': 'production',
- 'table_name': 'tabTask Type',
- 'table_rows': 2},
- {'database_name': 'production',
- 'table_name': 'tabTax Category',
- 'table_rows': 2},
- {'database_name': 'production', 'table_name': 'tabTax Rule', 'table_rows': 2},
- {'database_name': 'production',
- 'table_name': 'tabTaxable Salary Slab',
- 'table_rows': 4},
- {'database_name': 'production',
- 'table_name': 'tabTerms and Conditions',
- 'table_rows': 6},
- {'database_name': 'production',
- 'table_name': 'tabTerritory',
- 'table_rows': 18},
- {'database_name': 'production',
- 'table_name': 'tabTimesheet Detail',
- 'table_rows': 402},
- {'database_name': 'production', 'table_name': 'tabToDo', 'table_rows': 632},
- {'database_name': 'production',
- 'table_name': 'tabToDo Context',
- 'table_rows': 5},
- {'database_name': 'production',
- 'table_name': 'tabTranslation',
- 'table_rows': 22},
- {'database_name': 'production', 'table_name': 'tabUOM', 'table_rows': 684},
- {'database_name': 'production',
- 'table_name': 'tabUOM Category',
- 'table_rows': 17},
- {'database_name': 'production',
- 'table_name': 'tabUOM Conversion Detail',
- 'table_rows': 3786},
- {'database_name': 'production',
- 'table_name': 'tabUOM Conversion Factor',
- 'table_rows': 235},
- {'database_name': 'production', 'table_name': 'tabUser', 'table_rows': 328},
- {'database_name': 'production',
- 'table_name': 'tabUser Permission',
- 'table_rows': 325},
- {'database_name': 'production',
- 'table_name': 'tabUser Social Login',
- 'table_rows': 211},
- {'database_name': 'production', 'table_name': 'tabVehicle', 'table_rows': 6},
- {'database_name': 'production',
- 'table_name': 'tabVersion',
- 'table_rows': 9461993},
- {'database_name': 'production', 'table_name': 'tabView Log', 'table_rows': 4},
- {'database_name': 'production',
- 'table_name': 'tabVolume Conversion Detail',
- 'table_rows': 154},
- {'database_name': 'production',
- 'table_name': 'tabWarehouse',
- 'table_rows': 56},
- {'database_name': 'production',
- 'table_name': 'tabWarehouse Group',
- 'table_rows': 8},
- {'database_name': 'production',
- 'table_name': 'tabWarehouse Group Item',
- 'table_rows': 36},
- {'database_name': 'production',
- 'table_name': 'tabWarehouse Type',
- 'table_rows': 3},
- {'database_name': 'production',
- 'table_name': 'tabWeb Form',
- 'table_rows': 15},
- {'database_name': 'production',
- 'table_name': 'tabWeb Form Field',
- 'table_rows': 112},
- {'database_name': 'production',
- 'table_name': 'tabWebsite Callback Configuration Endpoints',
- 'table_rows': 2},
- {'database_name': 'production',
- 'table_name': 'tabWebsite Theme',
- 'table_rows': 1},
- {'database_name': 'production',
- 'table_name': 'tabWeight Conversion Detail',
- 'table_rows': 154},
- {'database_name': 'production',
- 'table_name': 'tabWoocommerce Order',
- 'table_rows': 2341},
- {'database_name': 'production',
- 'table_name': 'tabWoocommerce Order Item',
- 'table_rows': 3080},
- {'database_name': 'production',
- 'table_name': 'tabWork Order',
- 'table_rows': 2599},
- {'database_name': 'production',
- 'table_name': 'tabWork Order Item',
- 'table_rows': 12964},
- {'database_name': 'production',
- 'table_name': 'tabWorkflow Action Master',
- 'table_rows': 3},
- {'database_name': 'production',
- 'table_name': 'tabWorkflow State',
- 'table_rows': 3},
- {'database_name': 'production',
- 'table_name': 'tabYPOS Account',
- 'table_rows': 90},
- {'database_name': 'production',
- 'table_name': 'tabYPOS Aggregator Customer',
- 'table_rows': 4},
- {'database_name': 'production',
- 'table_name': 'tabYPOS Canal',
- 'table_rows': 9},
- {'database_name': 'production',
- 'table_name': 'tabYPOS Connector',
- 'table_rows': 11},
- {'database_name': 'production',
- 'table_name': 'tabYPOS Doctype Mapper',
- 'table_rows': 1},
- {'database_name': 'production',
- 'table_name': 'tabYPOS Doctype Mapper Child',
- 'table_rows': 7},
- {'database_name': 'production',
- 'table_name': 'tabYPOS Invoice Import',
- 'table_rows': 771626},
- {'database_name': 'production',
- 'table_name': 'tabYPOS Item Sync',
- 'table_rows': 10029},
- {'database_name': 'production',
- 'table_name': 'tabYPOS Price Mapper Child',
- 'table_rows': 3},
- {'database_name': 'production',
- 'table_name': 'tabYPOS Sales Channel',
- 'table_rows': 173},
- {'database_name': 'production',
- 'table_name': 'tabYPOS Sales Channel Sync',
- 'table_rows': 760},
- {'database_name': 'production',
- 'table_name': 'tempCost Center',
- 'table_rows': 2077},
- {'database_name': 'production', 'table_name': 'tmpacct', 'table_rows': 1410},
- {'database_name': 'production', 'table_name': '__Auth', 'table_rows': 108},
- {'database_name': 'production',
- 'table_name': '__global_search',
- 'table_rows': 2904073},
- {'database_name': 'production',
- 'table_name': '__UserSettings',
- 'table_rows': 3023}]
- tables_production = {table['table_name']: table for table in res_production}
- # staging tables
- query = """
- select table_schema as database_name,
- table_name,
- table_rows
- from information_schema.tables
- where table_type = 'BASE TABLE'
- and table_schema not in('information_schema', 'sys',
- 'performance_schema', 'mysql')
- and table_schema = 'staging'
- order by table_schema,
- table_name;
- """
- res_staging = frappe.db.sql(query, as_dict=True)
- tables_staging = {table['table_name']: table for table in res_staging}
- tables_diff = dict()
- for name, table in tables_production.items():
- table_staging = tables_staging.get(name, dict())
- tables_diff[name] = {
- "table_production": table,
- "table_staging": table_staging,
- "table_rows_diff": table_staging.get("table_rows", 0) - table.get("table_rows", 0)
- }
- tables_failed = {name: table for name, table in tables_diff.items() if abs(table.get('table_rows_diff')) >= table['table_production']['table_rows']}
Add Comment
Please, Sign In to add comment