Skip to content

Instantly share code, notes, and snippets.

CREATE TABLE `appInfo` (
`id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`createdBy` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`dateCreated` bigint NOT NULL,
`isDeleted` bit(1) NOT NULL,
`lastModified` bigint NOT NULL,
`lastModifiedBy` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`appBuildNumber` int NOT NULL,
`appPlatform` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`appType` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
Local MAC (BLOCK SIZE 4 Kb):
Jobs (37k iops): 4 (f=4): [r(4)][100.0%][r=145MiB/s][r=37.0k IOPS][eta 00m:00s]
Comment - 37k IOPS which is good enough:
Local MAC(Block Size 4Kb Block Size):
READ: bw=140MiB/s (146MB/s), 140MiB/s-140MiB/s (146MB/s-146MB/s), io=8380MiB (8787MB), run=60002-60002msec
Local MAC(Block Size 1 MB):
Jobs: 4 (f=4): [r(4)][100.0%][r=1599MiB/s][r=1598 IOPS][eta 00m:00s]
READ: bw=1227MiB/s (1287MB/s), 1227MiB/s-1227MiB/s (1287MB/s-1287MB/s), io=71.9GiB (77.2GB), run=60038-60038msec
drop table productEntityMapping;
drop table industrySector;
drop table vendor;
drop table buyer;
drop table buyerStats;
drop table serviceProvider;
drop table paymentRequestDocument;
drop table entityDocument;
drop table invoiceDocument;
drop table purchaseOrderAssociatedInfoDocument;
voucher-automap-pre.sql ----->
alter table voucherEntry
add column `autoMapRemaining` bit(1) NOT NULL default true;
alter table voucherEntry
add column `partyType` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL;
alter table bill
# in the parent mysql server, to set password for yoda user
USE mysql;
UPDATE user SET authentication_string='' WHERE User='root' AND Host='localhost';
FLUSH PRIVILEGES;
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '';
FLUSH PRIVILEGES;
# login to data backup and stop its mysql, to avoid data corruption
# Pre Steps(one time) - setup xtrabackup for mysql 8
wget https://repo.percona.com/apt/percona-release_latest.generic_all.deb
sudo dpkg -i percona-release_latest.generic_all.deb
sudo percona-release enable-only tools
sudo apt-get update
sudo apt install percona-xtrabackup-80
## BACKUP SCRIPT
#!/bin/bash
POST /api/v1/transferOrder
BODY:
TransferOrderCreateDto:
private String dispatchingInventoryId;
private String dispatchingZoneId; // only those zoneIds which have dispatch property enabled
private String receivingInventoryId;
private String receivingZoneId; // only those zoneIds which have delivery property enabled
private Long expDeliveryDate; // EDD
private String remarks;
private TransferOrderSourceType sourceType; // PURCHASE_INDENT/SELF -- currently only SELF
@bhuvanrawal
bhuvanrawal / gist:69eba3b133f83f83290c2a8cdb80e9e0
Created November 8, 2023 16:05
MRP migration for Payment Request redesign
ALTER TABLE paymentRequest DROP COLUMN prSeries;
ALTER TABLE paymentRequest ADD COLUMN paymentMode varchar(255) not null;
UPDATE paymentRequest SET paymentMode = 'BANK_TRANSFER';
ALTER TABLE paymentRequest CHANGE prType paymentRequestType varchar(255) not null;
update paymentRequest set paymentRequestType = 'ADVANCE' where paymentRequestType = 'VENDOR_ADVANCE';
update paymentRequest set paymentRequestType = 'SETTLEMENT' where paymentRequestType = 'VENDOR_SETTLEMENT';
update paymentRequest set paymentRequestType = 'SETTLEMENT' where paymentRequestType = 'SERVICE_PROVIDER';
ALTER TABLE paymentRequest CHANGE prStatus status varchar(255);
ALTER TABLE paymentRequest CHANGE shortPaymentRequestId shortId varchar(255) NOT NULL;
ALTER TABLE paymentRequest CHANGE prAmount requestedAmount decimal(19,6);
@Service
public class IdGenerationService {
public IdGenerationService(IcicleIdGenerator icicleIdGenerator) {
this.icicleIdGenerator = icicleIdGenerator;
}
public synchronized String getUniqueId() {
Optional<Id> idOptional = icicleIdGenerator.generateId();
String id = idOptional.get().toString();
return id;
@bhuvanrawal
bhuvanrawal / Dispatch Schedule API
Last active October 8, 2023 04:22
Dispatch Schedule API
Organisation to have schedules enabled or disabled
GET /api/v1/organisationProperty/find/{organisationId}
-> to be changed in DUPLICATE_GST_ALLOWED and DO_WITHOUT_INVENTORY
Create
POST /api/v1/schedule/
{
String sourceId;
String scheduleNumber;
long startDate;