makefile 912 B

1234567891011121314151617181920212223242526272829
  1. #!/bin/bash
  2. # generate model with cache from ddl
  3. fromDDLWithCache:
  4. goctl template clean
  5. goctl model mysql ddl -src="./sql/*.sql" -dir="./sql/model/cache" -cache
  6. fromDDLWithCacheAndIgnoreColumns:
  7. goctl template clean
  8. goctl model mysql ddl -src="./sql/*.sql" -dir="./sql/model/ignore_columns/cache" -cache -i 'gmt_create,create_at' -i 'gmt_modified,update_at'
  9. fromDDLWithCacheAndDb:
  10. goctl template clean
  11. goctl model mysql ddl -src="./sql/*.sql" -dir="./sql/model/cache_db" -database="1gozero" -cache
  12. fromDDLWithoutCache:
  13. goctl template clean;
  14. goctl model mysql ddl -src="./sql/*.sql" -dir="./sql/model/nocache"
  15. # generate model with cache from data source
  16. user=root
  17. password=password
  18. datasource=127.0.0.1:3306
  19. database=gozero
  20. fromDataSource:
  21. goctl template clean
  22. goctl model mysql datasource -url="$(user):$(password)@tcp($(datasource))/$(database)" -table="*" -dir ./model/cache -c -style gozero