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

Insert CREATE TABLE IF NOT EXISTS in SQL statements #2313

Open
thiagogomesverissimo opened this Issue Sep 24, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@thiagogomesverissimo

thiagogomesverissimo commented Sep 24, 2018

Hi,

This issue is a tip, not a bug.
I am writing some ansible tasks to deploy and test freeradius.
I know that the idea is to change the queries/schemas in sql mode, but to make easier to build an idempotent script to deploy freeradius in sql mode with default configuration (i,e, a script that can be re-runned mutiple times), this change would be useful.

So, the proposal is to change SQLs in mods-config/sql/main folder.
Example for mysql and table radacct:
from:
CREATE TABLE radacct
to:
CREATE TABLE IF NOT EXISTS radacct

https://github.com/FreeRADIUS/freeradius-server/blob/master/raddb/mods-config/sql/main/mysql/schema.sql

If you like this idea, I can send a PR to all dialects fixing this. If not, all right, I can close this issue.

@alandekok

This comment has been minimized.

Show comment
Hide comment
@alandekok

alandekok Sep 24, 2018

Member

This sounds reasonable. My only worry would be people who've created the table incorrectly. But... that's a problem for them to fix.

Member

alandekok commented Sep 24, 2018

This sounds reasonable. My only worry would be people who've created the table incorrectly. But... that's a problem for them to fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment