CoiniumServ
CoiniumServ copied to clipboard
An exception occured while getting block; Table '.Payment' doesn't exist
Hello there, am I missing a SQL file somewhere?
I am getting the following: An exception occured while getting block; Table '.Payment' doesn't exist (I removed my database name).
I imported the MPOS sql file that fixed the other SQL errors but where is this table? Is there a SQL file Im missing? Thank you
I am using the Hybrid Database Mode
MPOS sql file should be fine actually.
Where did you find the .sql file as I cannot nor find any reference to it in the wiki
https://github.com/MPOS/php-mpos/tree/master/sql
Did this ever get solved? I have the same error using hybrid db. I tried creating a new DB and imported the MPOS sql and I got even more errors. Does the payment table not get created until the first payment is made?
Side question, do I need a separate DB for each pool?
The issue is your MySQL version. You'll notice in the CoiniumServ logs:
09/21/2018 00:55:59 +09:30 [Debug] [MigrationManager] [BitCash] /* CreateTable Account */
09/21/2018 00:55:59 +09:30 [Debug] [MigrationManager] [BitCash] /* CreateIndex Account (Username) */
09/21/2018 00:55:59 +09:30 [Debug] [MigrationManager] [BitCash] /* !!! Specified key was too long; max key length is 767 bytes */
Up to MySQL 5.6 this limit is 767 bytes. From 5.7 on it's 3072 bytes. Install MySQL 5.7 or newer and it will work, you'll maybe have to regenerate the tables.
To stay on the current version of MySQL you're using, shove this SQL into your CoiniumServ DB:
CREATE TABLE Payment (
Id int(11) NOT NULL AUTO_INCREMENT,
Block int(11) NOT NULL,
AccountId int(11) NOT NULL,
Amount decimal(19,5) NOT NULL,
Completed tinyint(1) NOT NULL DEFAULT '0',
CreatedAt datetime NOT NULL,
PRIMARY KEY (Id),
KEY FK_Payment_Block_Block_Height (Block),
KEY FK_Payment_AccountId_Account_Id (AccountId),
CONSTRAINT FK_Payment_AccountId_Account_Id FOREIGN KEY (AccountId) REFERENCES Account (Id),
CONSTRAINT FK_Payment_Block_Block_Height FOREIGN KEY (Block) REFERENCES Block (Height)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE Transaction (
Id int(11) NOT NULL AUTO_INCREMENT,
AccountId int(11) NOT NULL,
PaymentId int(11) NOT NULL,
Amount decimal(19,5) NOT NULL,
Currency varchar(4) NOT NULL,
TxHash varchar(64) NOT NULL,
CreatedAt datetime NOT NULL,
PRIMARY KEY (Id),
KEY FK_Transaction_AccountId_Account_Id (AccountId),
KEY FK_Transaction_PaymentId_Payment_Id (PaymentId),
CONSTRAINT FK_Transaction_AccountId_Account_Id FOREIGN KEY (AccountId) REFERENCES Account (Id),
CONSTRAINT FK_Transaction_PaymentId_Payment_Id FOREIGN KEY (PaymentId) REFERENCES Payment (Id)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
Cheers.