Titanium JIRA Archive
Alloy (ALOY)

[ALOY-375] Alloy Model Generation providing incorrect adapter type within definition

GitHub Issuen/a
TypeBug
PriorityHigh
StatusResolved
ResolutionFixed
Resolution Date2013-01-24T21:04:19.000+0000
Affected Version/sn/a
Fix Version/sAlloy 1.0.0, 2013 Sprint 02
Componentsn/a
Labelsn/a
ReporterBert Grantges
AssigneeUnknown
Created2012-11-12T16:16:07.000+0000
Updated2018-03-07T22:25:59.000+0000

Description

Generate a simple model using Ti Studio, note sql is selected by default Expectation: Generated Model definition should have 'sql' as the adapter type Actual: Generated Model definition shows first column definition (in my case "title:varchar")

Comments

  1. Bert Grantges 2013-01-04

    bump - still seeing this with version 0.3.4
  2. Tony Lukasavage 2013-01-04

    Adding Chris Williams to watchers to get a Studio guy on this one. In the short term this will likely need a quick fix on the Studio side to account for the fact that the sql adapter has a slightly different format for generation than the other adapters. That is why you are getting the wrong value in the adapter field of the generated model. The long term solution is in the linked ticket (ALOY-407), which states that I need to rework the model generation CLI in order to make it uniform for all adapters so Studio isn't forced to account for these disparities between adapter types.
  3. Michael Xia 2013-01-04

    Hi Tony, I'll open a ticket on the Studio side for the quick fix. So is it that there is a different parameter we need to pass to the CLI for the sql adapter?
  4. Tony Lukasavage 2013-01-05

    I tested this with Alloy 0.3.4 just now and the following format will generate the model appropriately for all supported adapters types: (sql, properties, and localStorage):
       alloy generate model NAME ADAPTER_TYPE col1:type1 col2:type2 ...
       
    so for example, a sql model would be generated like this:
       alloy generate model myModel sql name:string value:integer
       
    Out of curiosity, what is the exact command TiStudio is calling now to generate models? I'm wondering how this error is occurring in the generation.
  5. Michael Xia 2013-01-06

    We are treating sql adapter type differently than the others, and we have a TODO saying "For now, we don't pass the 'sql' type at the end of the command. Once Alloy update their command API, we'll need to pass that as well." So look like we didn't update it after the alloy change. The command we're calling now is "alloy generate model myModel name:string active:boolean".
  6. Michael Xia 2013-01-07

    Created TISTUD-3137.
  7. Tony Lukasavage 2013-01-24

    Primary issue resolved in TISTUD-3137. Additional work providing more uniformity to the creation of models will be done in ALOY-407.

JSON Source