Skip to content
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

Add comments to db schema and set default last_modified #1276

Closed
wants to merge 1 commit into from

Conversation

Projects
None yet
2 participants
@imcdona
Copy link

imcdona commented Oct 20, 2017

Added comments explaining table functionality to MySQL schema. These comments can be viewed in MySQL when browsing the schema which helps admins understand what each table is used for.

Changed default value for "last_modified" in grp table from "1970-01-01 00:00:00" to CURRENT_TIMESTAMP and set to automatically update "last_modified" if the record is ever updated. This means that if a record is inserted without a "last_modified", MySQL will insert an accurate time-stamp instead of 0000-00-00 00:00:00 which breaks the SQLOPS module.

Pre-Submission Checklist

  • Commit message has the format required by CONTRIBUTING guide
  • Commits are split per component (core, individual modules, libs, utils, ...)
  • Each component has a single commit (if not, squash them into one commit)
  • No commits to README files for modules (changes must be done to docbook files
    in doc/ subfolder, the README file is autogenerated)

Type Of Change

  • Small bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds new functionality)
  • Breaking change (fix or feature that would change existing functionality)

Checklist:

  • PR should be backported to stable branches
  • Tested changes locally
  • Related to issue #XXXX (replace XXXX with an open issue number)

Description

Add comments to db schema and default timestamp
Added comments explaining table functionality to MySQL schema. These comments can be viewed in MySQL when browsing the schema which helps admins understand what each table is used for.

Changed default value for "last_modified" in grp table from "1970-01-01 00:00:00" to CURRENT_TIMESTAMP and set to automatically update "last_modified" if the record is ever updated. This means that if a record is inserted without a "last_modified", MySQL will insert an accurate time-stamp instead of 0000-00-00 00:00:00 which breaks the SQLOPS module.

@imcdona imcdona closed this Oct 20, 2017

@imcdona imcdona reopened this Oct 20, 2017

@miconda

This comment has been minimized.

Copy link
Member

miconda commented Oct 23, 2017

Are you using misc/scripts/mysql/my_create.sql? This is for SER flavour, not used by Kamailio these days. It's there for the case someone will needed by using an old ser version.

The definition of sql tables for kamailio is done via xml files located in src/lib/srdb1/schema/ and sql scripts are generated using make dbschema. From the xml files is generated only a doc describing the tables:

If you want to do something similar for kamailio sql scripts, you will have to work on the flow with the xml files.

For now I am closing this one, being with a patch done to a file not really used these days. If you want to be applied there, reopen and we can discuss further.

@miconda miconda closed this Oct 23, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.