Welcome to the nuBuilder Forums!
Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.
Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.
UNIQUE key on the sus_login_name column
-
- Posts: 156
- Joined: Wed Dec 23, 2020 12:28 pm
- Location: Russia, Volgograd
- Has thanked: 32 times
- Been thanked: 7 times
- Contact:
UNIQUE key on the sus_login_name column
For the zzzzsys_user table, after each update, I add a UNIQUE key on the sus_login_name column. I don't understand why this key is not set by default?
Wbr, miasoft.
-
- nuBuilder Team
- Posts: 4565
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 76 times
- Been thanked: 529 times
- Contact:
Re: UNIQUE key on the sus_login_name column
Do you mean a unique constraint?
Why would you want to add it?
All changes to zzzz-tables are overwritten with an update.
Why would you want to add it?
All changes to zzzz-tables are overwritten with an update.
-
- Posts: 156
- Joined: Wed Dec 23, 2020 12:28 pm
- Location: Russia, Volgograd
- Has thanked: 32 times
- Been thanked: 7 times
- Contact:
Re: UNIQUE key on the sus_login_name column
How is the uniqueness of sus_login_name checked? MySql rules or PHP-code? UNIQUE key needed for non-NUBuider programm (for me)
Wbr, miasoft.
-
- nuBuilder Team
- Posts: 4565
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 76 times
- Been thanked: 529 times
- Contact:
Re: UNIQUE key on the sus_login_name column
Uniqueness is ensured by code.
I might be able to provide some post-update functionality that allows you to run scripts after each update.
I might be able to provide some post-update functionality that allows you to run scripts after each update.
-
- nuBuilder Team
- Posts: 4565
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 76 times
- Been thanked: 529 times
- Contact:
-
- Posts: 156
- Joined: Wed Dec 23, 2020 12:28 pm
- Location: Russia, Volgograd
- Has thanked: 32 times
- Been thanked: 7 times
- Contact:
-
- nuBuilder Team
- Posts: 4565
- Joined: Sun Oct 14, 2018 6:43 pm
- Has thanked: 76 times
- Been thanked: 529 times
- Contact:
Re: UNIQUE key on the sus_login_name column
There's now a possibility to run scripts after each update.
If the Procedure called nuAfterUpdate function exists, it will be run after an update.
Example:
If the Procedure called nuAfterUpdate function exists, it will be run after an update.
Example:
Code: Select all
// Add a unique key to zzzzsys_user.sus_login_name
nuRunQuery(" ALTER TABLE `zzzzsys_user` ADD UNIQUE(`sus_login_name`) ";
You do not have the required permissions to view the files attached to this post.
-
- Posts: 156
- Joined: Wed Dec 23, 2020 12:28 pm
- Location: Russia, Volgograd
- Has thanked: 32 times
- Been thanked: 7 times
- Contact:
Re: UNIQUE key on the sus_login_name column
Thanks! I updated from Github. All work fine.
It's typo in script. Corrected:
It's typo in script. Corrected:
Code: Select all
nuRunQuery(" ALTER TABLE `zzzzsys_user` ADD UNIQUE(`sus_login_name`) ");
Wbr, miasoft.