Skip to content

Commit

Permalink
Shard updates, mysql uuid type, and api route bug fix (#1319)
Browse files Browse the repository at this point in the history
* update database versions

* update micrate shard

* add mysql uuid field type

* fixed printing api routes
  • Loading branch information
kalinon authored May 7, 2023
1 parent d7333fc commit 8f60747
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
8 changes: 4 additions & 4 deletions shard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,19 @@ dependencies:

micrate:
github: amberframework/micrate
version: ~> 0.12.0
version: ~> 0.15.0

pg:
github: will/crystal-pg
version: ~> 0.23.0
version: ~> 0.26.0

mysql:
github: crystal-lang/crystal-mysql
version: ~> 0.13.0
version: ~> 0.14.0

sqlite3:
github: crystal-lang/crystal-sqlite3
version: ~> 0.18.0
version: ~> 0.19.0

redis:
github: stefanwille/crystal-redis
Expand Down
13 changes: 7 additions & 6 deletions src/amber/cli/commands/routes.cr
Original file line number Diff line number Diff line change
Expand Up @@ -75,20 +75,21 @@ module Amber::CLI
if route_match = resource_string.to_s.match(RESOURCE_ROUTE_REGEX)
filter = route_match[4]?
filter_actions = route_match[5]?.to_s.gsub(/\:|\s/, "").split(",")

ACTION_MAPPING.each do |verb, v|
v.each do |action|
case filter
when "only"
next unless filter_actions.includes?(action)
when "except"
next if filter_actions.includes?(action)
else
build_route(
verb: verb, controller: route_match[3]?, action: action,
pipeline: current_pipe, scope: current_scope,
uri_pattern: build_uri_pattern(route_match[2]?, action, current_scope)
)
end

build_route(
verb: verb, controller: route_match[3]?, action: action,
pipeline: current_pipe, scope: current_scope,
uri_pattern: build_uri_pattern(route_match[2]?, action, current_scope)
)
end
end
end
Expand Down
1 change: 1 addition & 0 deletions src/amber/cli/generators/field.cr
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ module Amber::CLI
password: ["password", "String", "VARCHAR(255)"],
time: ["time", "Time", "TIMESTAMP NULL"],
timestamp: ["time", "Time", "TIMESTAMP NULL"],
uuid: ["uuid", "UUID", "binary(16)"],
},
sqlite: {
int: ["bigint", "Int64", "INT"],
Expand Down

0 comments on commit 8f60747

Please sign in to comment.