Comments (9)
It would be useful with common guideline for sql init and migration files. There are too many options. ๐
from project-layout.
Just for the fun of it i'll add another option:
/api/db
. Those sql file represent the data model for your data store and the/api
folder, in general, is a good place for the data model and interface descriptions (with swagger, protobufs, json schema, sql, etc) :-)
I don't like the idea of putting db
in the /api
folder. There are go-based projects that do not necessarily have anything to do with serving an API but still uses a database backend.
/db
(and /db/migrations
) seems more like the right fit to me.
from project-layout.
Im also at the point that there should be a /db
folder in the root for fixtures/migrations.
from project-layout.
It depends on your application design. Those files might be in the same directory with your corresponding packages and/or tools. The /configs
directory is another option (e.g., /configs/sql/
, /configs/templates
, /configs/localization
). This is what I usually do. Good option if you are ok with those files as separate dependencies you load at run time. You can also make them root level directories (e.g., /sql
, /templates
, /localization
). This is a good option too because it follows the /api
directory pattern especially if you intend to embed those resources in your binary.
from project-layout.
That's definitely an option too! Logos, images and other generic assets usually go there, but there's nothing prevents you from putting other things there :-)
from project-layout.
I keep email templates at /assets
because I thought it was exact place where it should be(?)
from project-layout.
@taisph, @kcq might be:
a) scripts/pg-migrations (not sure scripts
is intended to contain sql)
b) db/pg-migrations (a new db
top-level dir)
c) assets/pg-migrations (I afraid assets would become a "trash" dir, if so let it be named etc right away)
from project-layout.
I'm leaning towards /db
or /sql
. The former to avoid assuming the database is always SQL.
from project-layout.
A top level /db
makes sense (or /sql
if you don't care about keeping it generic :-)).
Just for the fun of it i'll add another option: /api/db
. Those sql file represent the data model for your data store and the /api
folder, in general, is a good place for the data model and interface descriptions (with swagger, protobufs, json schema, sql, etc) :-)
from project-layout.
Related Issues (20)
- singular? plural? HOT 3
- Duplicated simplified-chinese translated README HOT 1
- Guidance could be provided on where to put tests in library directories HOT 1
- Driver location
- Why there is no link to the Italian translations? HOT 1
- The release badge is broken
- Minio no longer uses /pkg in the project layout HOT 2
- How can I debug projects with this structure in VSCODE? HOT 2
- Question: best place to put "local environment" startup scripts ? (not Helm) HOT 1
- Why are some directories plural and others singular? Can it be unified?
- /api/proto to store protobuf definitions HOT 1
- what is Hacker license๏ผ HOT 1
- Regarding the description of the deprecated tool golint HOT 3
- Better to use the Go team's examples of project layout HOT 1
- Official layout documentation HOT 3
- Should auxiliary code generators be in `cmd/` or in `tools/`? HOT 2
- what's the meaning of these three question after chinese translations ?
- "Discussions" tab HOT 1
- How to run this project ? HOT 1
- Where should `/dao` be placed? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from project-layout.