-
-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added ExtraValueCommand #424
Conversation
I don't like the idea of this command. What would be an actual use case? I can just think of dumb pay2win stuff. |
Add could be used for rewards, remove could be used to punish players, set could be used for moderation. This could be used for dumb p2w stuff, but this is way too useful for dum server owners that don't know how to use mysql xD |
src/main/java/com/iridium/iridiumskyblock/managers/tablemanagers/TableManager.java
Outdated
Show resolved
Hide resolved
We dont have a way to alter databases atm, thats also why #389 hasnt been merged yet |
@dlsf any way for alter databases? |
Yeah, I can do it |
waiting for u <3 |
src/main/java/com/iridium/iridiumskyblock/commands/ExtraValueCommand.java
Show resolved
Hide resolved
src/main/java/com/iridium/iridiumskyblock/managers/tablemanagers/TableManager.java
Outdated
Show resolved
Hide resolved
try { | ||
double amount = Double.parseDouble(args[3]); | ||
switch (args[1].toUpperCase(Locale.ENGLISH)) { | ||
case "ADD": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use SubCommands
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nevermind, thats dum
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was about to say the same... But I don't know, it would be a very small subcommand.
I can do a subcommand PR soon that adds subcommands for the other commands too.
ALTER TABLE islands MODIFY name VARCHAR(512) NULL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whats this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did it, just added a newline because they are important
@@ -0,0 +1 @@ | |||
ALTER TABLE islands ADD COLUMN extra_value DOUBLE PRECISION; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldnt this be called _mysql? and where is the sqllite version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works for both MySQL and SQLite. The two different patches for MySQL and SQLite are optional
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SQLite doenst have the ALTER TABLE stuff though does it?
isnt that why we added the whole two different systems?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and why we had to do this mess for island names?
CREATE TEMPORARY TABLE islands_backup(id, name, home, visit, create_time, experience, color);
INSERT INTO islands_backup SELECT id, name, home, visit, create_time, experience, color FROM islands;
DROP TABLE islands;
CREATE TABLE islands(`id` INTEGER PRIMARY KEY AUTOINCREMENT , `name` VARCHAR , `home` VARCHAR , `visit` BOOLEAN , `create_time` BIGINT , `experience` INTEGER , `color` VARCHAR NOT NULL , UNIQUE (`name`));
INSERT INTO islands SELECT id, name, home, visit, create_time, experience, color FROM islands_backup;
DROP TABLE islands_backup;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because creating tables works differently, I guess? The syntax checker said it's not possible
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Im confused? We are adding a new collum into the table, ALTER TABLE keyword doesnt work for sqllite, and I just tested it, this doesnt work. We need to do what we did for IslandNames
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SQLite also has certain ALTER TABLE
statements: https://www.sqlite.org/lang_altertable.html
CREATE UNIQUE INDEX island_warps_id_name_island_id_uindex ON island_warps (id, name, island_id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whats this aswell?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need more newlines
No description provided.