# hub **Repository Path**: agentwyz/hub ## Basic Information - **Project Name**: hub - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2024-12-29 - **Last Updated**: 2025-01-07 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Hub ## 创建对应的数据库 ```shell sudo docker run -it \ --name postgres \ --privileged \ -e POSTGRES_PASSWORD=root \ -p 5432:5432 \ -v /usr/local/software/postgres/data:/var/lib/postgresql/data \ -d postgres ``` 进入数据库 ```shell docker exec -it postgres psql \l ``` ```shell mix phx.gen.context Gists Gist gists user_id:references:users name:string description:text marup_text:text mix phx.gen.context Gists SaveGist saved_gists user_id:references:users gist_id:references:gists mix phx.gen.context Comments Comment comments user_id:references:users gist_id:references:gists markup_text:text ``` 设置数据库模型之间的关联 ```shell mix ecto.migrate ```