Skip to content

Setting action/action_target_id not working with new ship insert. #23

@MisterGlass

Description

@MisterGlass

The goal of the example below is to create a new ship & set its action with one query:

      WITH new_ship as (
        INSERT INTO my_ships(
          name,
          attack, defense, engineering, prospecting,
          location,
          action,
          action_target_id
        )
        VALUES(
          'Miner',
          0,0,0,20,
          (SELECT location FROM planets WHERE id = 5),
          'MINE',
          5
        )
        RETURNING id
      )
      SELECT
        new_ship.id AS id,
        UPGRADE( new_ship.id, 'PROSPECTING', 480) AS status
      FROM new_ship

When executed, this query returns a success & create a ship, but DOES NOT set its action/action_target_id. This is a silent failure.

If possible, it would be great to get setting action/action_target_id working. Barring that, an error should be returned so that the client is aware of the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions