[S2GRAPH-179]: Add defaultValue on ColumnMeta

JIRA:
    [S2GRAPH-179] https://issues.apache.org/jira/browse/S2GRAPH-179

Pull Request:
    Closes #135

Author
    DO YUNG YOON <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/incubator-s2graph/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-s2graph/commit/aeaff3fc
Tree: http://git-wip-us.apache.org/repos/asf/incubator-s2graph/tree/aeaff3fc
Diff: http://git-wip-us.apache.org/repos/asf/incubator-s2graph/diff/aeaff3fc

Branch: refs/heads/master
Commit: aeaff3fc6e9c171d9ef6d52ff7ef048f5204be2d
Parents: 8dcb0f1 a191ef0
Author: DO YUNG YOON <[email protected]>
Authored: Tue Feb 27 17:04:01 2018 +0900
Committer: DO YUNG YOON <[email protected]>
Committed: Tue Feb 27 17:04:01 2018 +0900

----------------------------------------------------------------------
 CHANGES                                         |  1 +
 dev_support/graph_mysql/schema.sql              |  1 +
 .../org/apache/s2graph/core/mysqls/schema.sql   |  1 +
 .../org/apache/s2graph/core/Management.scala    |  6 ++-
 .../s2graph/core/S2EdgePropertyHelper.scala     |  5 +-
 .../apache/s2graph/core/S2GraphFactory.scala    | 48 ++++++++++----------
 .../org/apache/s2graph/core/S2VertexLike.scala  | 17 ++++++-
 .../s2graph/core/S2VertexPropertyHelper.scala   | 42 +++++++++++++++++
 .../apache/s2graph/core/io/Conversions.scala    |  2 +
 .../apache/s2graph/core/mysqls/ColumnMeta.scala | 16 ++++---
 .../s2graph/core/mysqls/ServiceColumn.scala     |  4 ++
 .../core/Integrate/IntegrateCommon.scala        |  9 ++--
 .../core/tinkerpop/S2GraphProvider.scala        | 18 ++++----
 .../rest/play/controllers/AdminController.scala |  2 +-
 14 files changed, 124 insertions(+), 48 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-s2graph/blob/aeaff3fc/CHANGES
----------------------------------------------------------------------
diff --cc CHANGES
index a7a6030,b6cb4ce..b54aaeb
--- a/CHANGES
+++ b/CHANGES
@@@ -38,6 -38,6 +38,7 @@@ Release Notes - S2Graph - Version 0.2.
      * [S2GRAPH-159] - Wrong syntax at a bash script under Linux
      * [S2GRAPH-168] - Fix args order mismatch when use addServiceColumnProp
      * [S2GRAPH-176] - Fix compile error on LabelMeta
++    * [S2GRAPH-179] - Add defaultValue on ColumnMeta
  
  ** Improvement
      * [S2GRAPH-72] - Support Apache TinkerPop and Gremlin

http://git-wip-us.apache.org/repos/asf/incubator-s2graph/blob/aeaff3fc/s2core/src/main/scala/org/apache/s2graph/core/Management.scala
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/incubator-s2graph/blob/aeaff3fc/s2core/src/main/scala/org/apache/s2graph/core/mysqls/ColumnMeta.scala
----------------------------------------------------------------------
diff --cc s2core/src/main/scala/org/apache/s2graph/core/mysqls/ColumnMeta.scala
index aed237d,cca6d10..51f4a93
--- a/s2core/src/main/scala/org/apache/s2graph/core/mysqls/ColumnMeta.scala
+++ b/s2core/src/main/scala/org/apache/s2graph/core/mysqls/ColumnMeta.scala
@@@ -35,12 -35,9 +35,12 @@@ object ColumnMeta extends Model[ColumnM
    val reservedMetas = Seq(timestamp, lastModifiedAtColumn)
    val reservedMetaNamesSet = reservedMetas.map(_.name).toSet
  
 +  def isValid(columnMeta: ColumnMeta): Boolean =
 +    columnMeta.id.isDefined && columnMeta.id.get > 0 && columnMeta.seq >= 0
 +
    def valueOf(rs: WrappedResultSet): ColumnMeta = {
      ColumnMeta(Some(rs.int("id")), rs.int("column_id"), rs.string("name"),
-       rs.byte("seq"), rs.string("data_type").toLowerCase(), 
rs.boolean("store_in_global_index"))
+       rs.byte("seq"), rs.string("data_type").toLowerCase(), 
rs.string("default_value"), rs.boolean("store_in_global_index"))
    }
  
    def findById(id: Int)(implicit session: DBSession = AutoSession) = {

http://git-wip-us.apache.org/repos/asf/incubator-s2graph/blob/aeaff3fc/s2core/src/main/scala/org/apache/s2graph/core/mysqls/ServiceColumn.scala
----------------------------------------------------------------------

Reply via email to