Programming Journal

学習したことの整理用です。

2022-01-01から1年間の記事一覧

MySQLでReadOnly権限のユーザーを作成する

概要 BIツール上でデータの更新・削除が行われることを防ぐために、MySQLでREADONLY権限のUserを作成したい。 前提 AWS踏み台サーバ経由でRDSに接続している 流れ ## EC2インスタンスへsshログインする ~/.ssh ❯ ssh -i ~/.ssh/id_rsa(秘密鍵) ec2-user@xxxx…

typeORM カラムの追加時の並び順を調整する

OverView descriptionカラムを追加したい。 created_at, updated_atの前に追加したい MySQL使用 import { Column, CreateDateColumn, Entity, PrimaryGeneratedColumn, UpdateDateColumn, } from 'typeorm' @Entity() export class Users{ @PrimaryGenerated…

NestJS with TypeORM Migrations

OverView NestJS * TypeORM Adding table columns using CLI ts-node and typeorm are already installed How to (1. Create an entity) 2. Adding table columns 3. Create a new migration 4. Run migrations Adding table columns / Edit entity file imp…

【React】ボタンをクリックすると特定のフォームまで自動スクロールする

概要 「問い合わせ」ボタンをクリックすると、ページ最下部の問い合わせフォームまで自動スクロールする useRefでDOMノードにアクセスし、scrollIntoViewでスクロールする export function Contact(): JSX.Element { const ref = useRef < HTMLDivElement > …

NestJSでCORSを許可する

エラー Frontend: Next.js Backend: NestJS で開発中にエラーが error Access to XMLHttpRequest at 'http://localhost:3001/tasks' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is pre…