I hereby claim:
- I am ayax79 on github.
- I am ayax (https://keybase.io/ayax) on keybase.
- I have a public key whose fingerprint is 251C 0033 F14C C154 6E1A C85A F5B4 E7CA 0013 7384
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| # | |
| # Migration to convert the posts.user_id from an internal id pointing to users.id columnt to be the external | |
| # serv guid. | |
| # | |
| # This migration was introduced as part of the user_rewrite work to remove the manage users table reliance and double writing to serv | |
| # | |
| UP: | |
| query: | |
| 1: ALTER TABLE posts MODIFY user_id varchar(40) | |
| 2: UPDATE posts LEFT JOIN users ON posts.user_id=users.id SET posts.user_id=users.core_user_guid; |
| var Role = Backbone.Model.extend({ | |
| urlRoot: '/roles/rest/roles', | |
| validate: function(atts) { | |
| var errors = []; | |
| if (!atts.name || atts.name === '') { | |
| errors.push({field:'name', message: 'Name is required.'}); | |
| } | |
| if (!atts.userGroups || atts.userGroups.length < 1) { |
| [INFO] [running phase icode on DbWorkflowUserStep.scala] | |
| [INFO] [running phase icode on MegaWorkflow.scala] | |
| [INFO] [running phase icode on StepCompleteListener.scala] | |
| [INFO] [running phase icode on VoteListener.scala] | |
| [INFO] [running phase icode on WorkflowCronListener.scala] | |
| [INFO] [running phase icode on WorkflowEmailService.scala] | |
| [INFO] java.lang.reflect.InvocationTargetException | |
| [INFO] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) | |
| [INFO] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) | |
| [INFO] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) |
| git diff --no-prefix master -- \ | |
| ./core/src/main/scala/com/syncapse/serv/core/system/model/Company.scala \ | |
| ./core/src/main/scala/com/syncapse/serv/core/system/util/JDBCUtils.scala \ | |
| ./thrift/src/main/scala/com/syncapse/serv/thrift/ThriftHelper.scala \ | |
| ./thrift/src/main/scala/com/syncapse/serv/thrift/company/CompanyGatewayHandler.scala \ | |
| ./core/src/main/scala/com/syncapse/serv/core/migrate/plan/Migrate_data_20120213113021_Migrate_Direct_Response_Templates.scala \ | |
| ./core/src/main/scala/com/syncapse/workflow/core/model/WorkflowStep.scala \ | |
| ./core/src/main/scala/com/syncapse/workflow/engine/WorkflowEngine.scala \ | |
| ./thrift/src/main/java/com/syncapse/serv/thrift/client/Gateway.java \ | |
| ./thrift/src/main/thrift/gateway.thrift \ |
| commit e70b63308d85fc5c34ba4e7d7e8d8e04ccc7624e | |
| Author: Kirk Peterson <[email protected]> | |
| Date: Tue Feb 21 10:43:28 2012 -0800 | |
| #24720:updated JDBCUtils to support Named Parameters, changed descendants functions to better suit Build's needs | |
| .../syncapse/serv/core/system/model/Company.scala | 116 +++++---- | |
| .../syncapse/serv/core/system/util/JDBCUtils.scala | 269 ++++++++++++++++++-- | |
| .../com/syncapse/serv/thrift/ThriftHelper.scala | 2 +- | |
| .../thrift/company/CompanyGatewayHandler.scala | 4 +- |
| mysql> desc companies_users; | |
| +--------------+--------------------------------------+------+-----+-------------------+-----------------------------+ | |
| | Field | Type | Null | Key | Default | Extra | | |
| +--------------+--------------------------------------+------+-----+-------------------+-----------------------------+ | |
| | id | int(10) unsigned | NO | PRI | NULL | auto_increment | | |
| | company_id | int(10) unsigned | NO | MUL | NULL | | | |
| | user_id | int(10) unsigned | NO | | NULL | | | |
| | access_level | enum('normal','admin','creator') | NO | MUL | normal | | | |
| | status | enum('enabled','disabled','deleted') | NO | MUL | enabled | | | |
| | created | datetime |
| try { User.asSystem { subatomic { User().nodes(Stream(Company().name("Syncapse").lookup())).email() } } } catch { case t: Throwable => t.printStackTrace() } | |
| 2012-01-05 14:32:48,336 [main] ERROR c.s.s.common.atomic.Atomic$$anon$1 - Undoing atomic operation due to exception com.syncapse.swim.entity.EntityAccessException: Can't read undefined field User.email | |
| com.syncapse.swim.entity.EntityAccessException: Can't read undefined field User.email | |
| at com.syncapse.swim.entity.Entity$Field$$anonfun$value$1$$anonfun$2.apply(Entity.scala:172) | |
| at com.syncapse.swim.entity.Entity$Field.com$syncapse$swim$entity$Entity$Field$$pull(Entity.scala:216) | |
| at com.syncapse.swim.entity.Entity$Field$$anonfun$value$1.apply(Entity.scala:178) | |
| at com.syncapse.swim.common.guard.Guard$.guard(Guard.scala:11) |
| def admins:Iterable[User] = { | |
| def rg = RoleGrant().userGroup(UserGroup().users(Stream(User().nodes(Stream(this))))) | |
| def findRole(nm: String) = Role().name(nm).lookfor() | |
| val query = List(findRole("Manage Administrator"), findRole("synadmin"), findRole("admin")).filter(_.isDefined).map(_.get) match { | |
| case head :: tail => Option(tail.foldLeft(rg.role(head))((b, role) => b.|(role))) | |
| case head :: Nil => Option(rg.role(head)) | |
| case _ => Option.empty[RoleGrant] | |
| } | |
| private def latestActivity(l: Location): Option[DateTime] = { | |
| val journals = l.workflows().map(wf => WorkflowJournal().workflow(wf).lookfor()).filter(_.isDefined).map(_.get) | |
| val sortedDates = journals.map(_.modifiedTimestamp()).sortWith(_.compareTo(_) > 0) // this should make it reversed | |
| if (!sortedDates.isEmpty) Some(sortedDates.head) | |
| else None | |
| } |