From 73c056a54a88d409a247397c3e09fe82f286e2f7 Mon Sep 17 00:00:00 2001 From: manabeai Date: Mon, 13 Oct 2025 04:12:05 +0000 Subject: [PATCH 1/3] =?UTF-8?q?=E9=96=8B=E7=99=BA=E7=92=B0=E5=A2=83?= =?UTF-8?q?=E3=81=AE=E8=A8=AD=E5=AE=9A=E9=96=A2=E9=80=A3=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .devcontainer/Dockerfile | 37 ++++++++++ .devcontainer/devcontainer.json | 73 +++++++++++++++++++ .devcontainer/docker-compose.yml | 41 +++++++++++ .gitignore | 2 + settings.gradle.kts | 0 .../api/shared/config/SecurityConfig.kt | 24 ++++++ .../presentation/HealthCheckController.kt | 36 +++++++++ src/main/resources/application-dev.properties | 36 +++++++++ 8 files changed, 249 insertions(+) create mode 100755 .devcontainer/Dockerfile create mode 100755 .devcontainer/devcontainer.json create mode 100755 .devcontainer/docker-compose.yml mode change 100644 => 100755 .gitignore mode change 100644 => 100755 settings.gradle.kts create mode 100644 src/main/kotlin/com/mofecoder/api/shared/config/SecurityConfig.kt create mode 100644 src/main/kotlin/com/mofecoder/api/submission/presentation/HealthCheckController.kt create mode 100755 src/main/resources/application-dev.properties diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100755 index 0000000..ee94578 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,37 @@ +FROM mcr.microsoft.com/devcontainers/java:1-21-bullseye + +# Install additional tools +RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ + && apt-get -y install --no-install-recommends \ + curl \ + wget \ + git \ + unzip \ + zip \ + default-mysql-client \ + vim \ + lsof \ + net-tools + +# Install Docker CLI +RUN apt-get update && apt-get install -y \ + ca-certificates \ + curl \ + gnupg \ + lsb-release \ + && mkdir -p /etc/apt/keyrings \ + && curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg \ + && echo \ + "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \ + $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null \ + && apt-get update \ + && apt-get install -y docker-ce-cli + +# Clean up +RUN apt-get clean && rm -rf /var/lib/apt/lists/* + +# Set the default user to vscode +USER vscode + +# Set working directory +WORKDIR /workspace diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100755 index 0000000..099a5dd --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,73 @@ +{ + "name": "Mofe API Dev Container", + "dockerComposeFile": ["../compose.yaml", "docker-compose.yml"], + "service": "app", + "workspaceFolder": "/workspace", + "shutdownAction": "stopCompose", + + "features": { + "ghcr.io/devcontainers/features/java:1": { + "version": "21", + "installGradle": "true" + }, + "ghcr.io/devcontainers/features/git:1": {} + }, + + "customizations": { + "vscode": { + "extensions": [ + "vscjava.vscode-java-pack", + "fwcd.kotlin", + "ms-vscode.vscode-spring-initializr", + "vmware.vscode-spring-boot", + "vscjava.vscode-spring-boot-dashboard", + "gabrielbb.vscode-lombok", + "redhat.vscode-yaml", + "ms-vscode.vscode-json", + "bradlc.vscode-tailwindcss", + "esbenp.prettier-vscode", + "ms-vscode.vscode-docker" + ], + "settings": { + "java.configuration.runtimes": [ + { + "name": "JavaSE-21", + "path": "/usr/local/sdkman/candidates/java/current" + } + ], + "java.compile.nullAnalysis.mode": "automatic", + "spring-boot.ls.logfile": { + "on": true + } + } + } + }, + + "forwardPorts": [8080, 3306, 5672, 15672], + "portsAttributes": { + "8080": { + "label": "Spring Boot App", + "onAutoForward": "notify" + }, + "3306": { + "label": "MySQL/MariaDB" + }, + "5672": { + "label": "RabbitMQ" + }, + "15672": { + "label": "RabbitMQ Management" + } + }, + + "postCreateCommand": "chmod +x gradlew", + "postStartCommand": "sudo service docker start", + + "remoteEnv": { + "SPRING_PROFILES_ACTIVE": "dev" + }, + + "mounts": [ + "source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind" + ] +} diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml new file mode 100755 index 0000000..b11632b --- /dev/null +++ b/.devcontainer/docker-compose.yml @@ -0,0 +1,41 @@ +services: + app: + build: + context: .. + dockerfile: .devcontainer/Dockerfile + volumes: + - ..:/workspaces/mofe-api:cached + command: sleep infinity + network_mode: service:db + depends_on: + - db + - rabbitmq + + db: + image: 'mariadb:latest' + restart: unless-stopped + environment: + - 'MARIADB_DATABASE=cafecoder_back_rails_development' + - 'MARIADB_PASSWORD=password' + - 'MARIADB_ROOT_PASSWORD=password' + - 'MARIADB_USER=root' + ports: + - '3306:3306' + volumes: + - mariadb-data:/var/lib/mysql + + rabbitmq: + image: 'rabbitmq:3-management' + restart: unless-stopped + environment: + - 'RABBITMQ_DEFAULT_PASS=secret' + - 'RABBITMQ_DEFAULT_USER=myuser' + ports: + - '5672:5672' + - '15672:15672' + volumes: + - rabbitmq-data:/var/lib/rabbitmq + +volumes: + mariadb-data: + rabbitmq-data: diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 index 5a979af..9fe2eb1 --- a/.gitignore +++ b/.gitignore @@ -38,3 +38,5 @@ out/ ### Kotlin ### .kotlin + +.env \ No newline at end of file diff --git a/settings.gradle.kts b/settings.gradle.kts old mode 100644 new mode 100755 diff --git a/src/main/kotlin/com/mofecoder/api/shared/config/SecurityConfig.kt b/src/main/kotlin/com/mofecoder/api/shared/config/SecurityConfig.kt new file mode 100644 index 0000000..d686b77 --- /dev/null +++ b/src/main/kotlin/com/mofecoder/api/shared/config/SecurityConfig.kt @@ -0,0 +1,24 @@ +package com.mofecoder.api.shared.config + +import org.springframework.context.annotation.Bean +import org.springframework.context.annotation.Configuration +import org.springframework.security.config.annotation.web.builders.HttpSecurity +import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity +import org.springframework.security.web.SecurityFilterChain +import org.springframework.context.annotation.Profile + +@Configuration +@EnableWebSecurity +@Profile("dev") // 開発環境だけで認証スキップ +class DevSecurityConfig { + + @Bean + fun devFilterChain(http: HttpSecurity): SecurityFilterChain { + http + .authorizeHttpRequests { + it.requestMatchers("/**").permitAll() // 全て許可 + } + .csrf { it.disable() } + return http.build() + } +} diff --git a/src/main/kotlin/com/mofecoder/api/submission/presentation/HealthCheckController.kt b/src/main/kotlin/com/mofecoder/api/submission/presentation/HealthCheckController.kt new file mode 100644 index 0000000..aeab641 --- /dev/null +++ b/src/main/kotlin/com/mofecoder/api/submission/presentation/HealthCheckController.kt @@ -0,0 +1,36 @@ +package com.mofecoder.api.submission.presentation + +import io.swagger.v3.oas.annotations.Operation +import io.swagger.v3.oas.annotations.responses.ApiResponse +import io.swagger.v3.oas.annotations.tags.Tag +import org.springframework.http.HttpStatus +import org.springframework.http.ResponseEntity +import org.springframework.web.bind.annotation.GetMapping +import org.springframework.web.bind.annotation.RequestMapping +import org.springframework.web.bind.annotation.RestController + +@RestController +@RequestMapping("/health") +@Tag(name = "Health Check", description = "アプリケーションのヘルスチェック") +class HealthCheckController { + + @GetMapping + @Operation( + summary = "ヘルスチェック", + description = "アプリケーションの稼働状況を確認します。", + responses = [ + ApiResponse( + responseCode = "200", + description = "アプリケーションが正常に稼働している場合" + ) + ] + ) + fun healthCheck(): ResponseEntity> { + val response = mapOf( + "status" to "UP", + "timestamp" to System.currentTimeMillis(), + "service" to "mofe-submission-api" + ) + return ResponseEntity.ok(response) + } +} \ No newline at end of file diff --git a/src/main/resources/application-dev.properties b/src/main/resources/application-dev.properties new file mode 100755 index 0000000..7fe7e83 --- /dev/null +++ b/src/main/resources/application-dev.properties @@ -0,0 +1,36 @@ +# Dev Container用の開発設定 +spring.application.name=mofe-api +# spring.profiles.active=dev + +# データベース設定(Dev Container内のMariaDB) +spring.datasource.url=jdbc:mariadb://db:3306/cafecoder_back_rails_development +spring.datasource.username=root +spring.datasource.password=password +spring.datasource.driver-class-name=org.mariadb.jdbc.Driver + +# JPA/Hibernate設定 +spring.jpa.hibernate.ddl-auto=update +spring.jpa.show-sql=true +spring.jpa.properties.hibernate.format_sql=true + +# RabbitMQ設定 +spring.rabbitmq.host=rabbitmq +spring.rabbitmq.port=5672 +spring.rabbitmq.username=myuser +spring.rabbitmq.password=secret + +# ログ設定 +logging.level.com.mofecoder=DEBUG +logging.level.org.springframework.web=DEBUG +logging.level.org.springframework.security=DEBUG + +# アクチュエータ設定 +management.endpoints.web.exposure.include=health,info,metrics,prometheus +management.endpoint.health.show-details=always + +# セキュリティ設定(開発用) +spring.security.oauth2.resourceserver.jwt.issuer-uri=https://dev-auth.example.com +spring.security.oauth2.resourceserver.jwt.audiences=mofe-api + +# Docker Compose統合の無効化(Dev Containerでは不要) +spring.docker.compose.enabled=false \ No newline at end of file From e39b8fb45d66445cb501b9d2015f50130ef458ab Mon Sep 17 00:00:00 2001 From: manabeai Date: Mon, 13 Oct 2025 04:12:17 +0000 Subject: [PATCH 2/3] =?UTF-8?q?=E3=83=93=E3=83=AB=E3=83=89=E3=82=A8?= =?UTF-8?q?=E3=83=A9=E3=83=BC=E3=81=AE=E7=AE=87=E6=89=80=E3=82=92=E4=BB=AE?= =?UTF-8?q?=E3=81=A7=E5=9F=8B=E3=82=81=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.gradle.kts | 3 ++- .../com/mofecoder/api/problem/TaskSlug.kt | 12 ++++++++++ .../submission/factory/SubmissionFactory.kt | 23 ++++++++++++++++++- .../usecase/CreateSubmissionUseCase.kt | 4 +++- 4 files changed, 39 insertions(+), 3 deletions(-) mode change 100644 => 100755 build.gradle.kts create mode 100644 src/main/kotlin/com/mofecoder/api/problem/TaskSlug.kt diff --git a/build.gradle.kts b/build.gradle.kts old mode 100644 new mode 100755 index 1599cd1..2342786 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -41,7 +41,8 @@ dependencies { implementation("org.springframework.boot:spring-boot-starter-validation") implementation("org.springframework.boot:spring-boot-starter-web") implementation("com.fasterxml.jackson.module:jackson-module-kotlin") - implementation("com.google.cloud:spring-cloud-gcp-starter-storage") + // 認証がなくて動かなかったので一旦コメントアウト + // implementation("com.google.cloud:spring-cloud-gcp-starter-storage") implementation("io.sentry:sentry-spring-boot-starter-jakarta") implementation("org.jetbrains.kotlin:kotlin-reflect") implementation("org.springframework.modulith:spring-modulith-events-api") diff --git a/src/main/kotlin/com/mofecoder/api/problem/TaskSlug.kt b/src/main/kotlin/com/mofecoder/api/problem/TaskSlug.kt new file mode 100644 index 0000000..cf8000f --- /dev/null +++ b/src/main/kotlin/com/mofecoder/api/problem/TaskSlug.kt @@ -0,0 +1,12 @@ +package com.mofecoder.api.problem + +/** + * タスクのスラッグを表すvalue object + * 仮実装 - 後で詳細実装予定 + */ +@JvmInline +value class TaskSlug(val value: String) { + init { + require(value.isNotBlank()) { "TaskSlug cannot be blank" } + } +} diff --git a/src/main/kotlin/com/mofecoder/api/submission/factory/SubmissionFactory.kt b/src/main/kotlin/com/mofecoder/api/submission/factory/SubmissionFactory.kt index 8152d32..f9da9aa 100644 --- a/src/main/kotlin/com/mofecoder/api/submission/factory/SubmissionFactory.kt +++ b/src/main/kotlin/com/mofecoder/api/submission/factory/SubmissionFactory.kt @@ -1,12 +1,33 @@ package com.mofecoder.api.submission.factory +import com.mofecoder.api.problem.ProblemId +import com.mofecoder.api.shared.StoragePath +import com.mofecoder.api.shared.valueObject.UserId import com.mofecoder.api.submission.Submission +import com.mofecoder.api.submission.SubmissionId +import com.mofecoder.api.submission.domain.enum.SubmissionLanguage +import com.mofecoder.api.submission.domain.enum.SubmissionStatus +import com.mofecoder.api.submission.domain.valueObject.ExecutionResult +import com.mofecoder.api.submission.domain.valueObject.SubmissionLanguageEnvironment +import com.mofecoder.api.submission.domain.valueObject.SubmissionSourceReference class SubmissionFactory { private constructor() companion object { fun createSubmission(): Submission { - + // 仮実装 - 後で詳細実装予定 + // TODO: 適切なSubmissionインスタンスを作成して返す + return Submission( + submissionId = SubmissionId(1L), + problemId = ProblemId(1L), + submissionSource = SubmissionSourceReference(StoragePath("dummy-source-reference")), + status = SubmissionStatus.CP, + environment = SubmissionLanguageEnvironment(SubmissionLanguage.KOTLIN, "dummy-environment"), + isPublic = false, + userId = UserId(1L), + executionResult = null, + judgedTestcaseCount = null + ) } } } diff --git a/src/main/kotlin/com/mofecoder/api/submission/usecase/CreateSubmissionUseCase.kt b/src/main/kotlin/com/mofecoder/api/submission/usecase/CreateSubmissionUseCase.kt index 8aa22ff..6e0e91c 100644 --- a/src/main/kotlin/com/mofecoder/api/submission/usecase/CreateSubmissionUseCase.kt +++ b/src/main/kotlin/com/mofecoder/api/submission/usecase/CreateSubmissionUseCase.kt @@ -1,6 +1,7 @@ package com.mofecoder.api.submission.usecase import com.mofecoder.api.problem.ProblemId +import com.mofecoder.api.problem.TaskSlug import com.mofecoder.api.shared.valueObject.UserId import com.mofecoder.api.submission.domain.SubmissionRepository import org.springframework.transaction.annotation.Transactional @@ -15,6 +16,7 @@ class CreateSubmissionUseCase( sourceCode: String, language: String, ) { - + // 仮実装 - 後で詳細実装予定 + // TODO: Submissionエンティティを作成して保存する処理を実装 } } \ No newline at end of file From 7e60f5a05b4bba485b0078b348ae685005791806 Mon Sep 17 00:00:00 2001 From: manabeai Date: Mon, 13 Oct 2025 15:00:24 +0900 Subject: [PATCH 3/3] =?UTF-8?q?=E9=81=A9=E5=BD=93=E3=81=ABdump=E3=83=95?= =?UTF-8?q?=E3=82=A1=E3=82=A4=E3=83=AB=E3=82=92=E4=BD=9C=E3=81=A3=E3=81=A6?= =?UTF-8?q?=E5=88=9D=E6=9C=9F=E3=83=87=E3=83=BC=E3=82=BF=E3=81=A8=E3=81=97?= =?UTF-8?q?=E3=81=A6=E6=8A=95=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .devcontainer/docker-compose.yml | 1 + .devcontainer/dump.sql | 659 +++++++++++++++++++++++++++++++ 2 files changed, 660 insertions(+) create mode 100644 .devcontainer/dump.sql diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml index b11632b..ae47b1f 100755 --- a/.devcontainer/docker-compose.yml +++ b/.devcontainer/docker-compose.yml @@ -23,6 +23,7 @@ services: - '3306:3306' volumes: - mariadb-data:/var/lib/mysql + - ./dump.sql:/docker-entrypoint-initdb.d/dump.sql rabbitmq: image: 'rabbitmq:3-management' diff --git a/.devcontainer/dump.sql b/.devcontainer/dump.sql new file mode 100644 index 0000000..0c26ce2 --- /dev/null +++ b/.devcontainer/dump.sql @@ -0,0 +1,659 @@ +-- MySQL dump 10.13 Distrib 5.7.44, for Linux (x86_64) +-- +-- Host: localhost Database: cafecoder_back_rails_development +-- ------------------------------------------------------ +-- Server version 5.7.44 + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +-- +-- Current Database: `cafecoder_back_rails_development` +-- + +CREATE DATABASE /*!32312 IF NOT EXISTS*/ `cafecoder_back_rails_development` /*!40100 DEFAULT CHARACTER SET utf8mb4 */; + +USE `cafecoder_back_rails_development`; + +-- +-- Temporary table structure for view `all_registrations` +-- + +DROP TABLE IF EXISTS `all_registrations`; +/*!50001 DROP VIEW IF EXISTS `all_registrations`*/; +SET @saved_cs_client = @@character_set_client; +SET character_set_client = utf8; +/*!50001 CREATE VIEW `all_registrations` AS SELECT + 1 AS `id`, + 1 AS `contest_id`, + 1 AS `open_registration`, + 1 AS `created_at`, + 1 AS `updated_at`, + 1 AS `deleted_at`, + 1 AS `type`*/; +SET character_set_client = @saved_cs_client; + +-- +-- Table structure for table `ar_internal_metadata` +-- + +DROP TABLE IF EXISTS `ar_internal_metadata`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `ar_internal_metadata` ( + `key` varchar(255) NOT NULL, + `value` varchar(255) DEFAULT NULL, + `created_at` datetime(6) NOT NULL, + `updated_at` datetime(6) NOT NULL, + PRIMARY KEY (`key`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `ar_internal_metadata` +-- + +LOCK TABLES `ar_internal_metadata` WRITE; +/*!40000 ALTER TABLE `ar_internal_metadata` DISABLE KEYS */; +INSERT INTO `ar_internal_metadata` VALUES ('environment','development','2025-10-13 05:25:15.033991','2025-10-13 05:25:15.033991'),('schema_sha1','e0d9a53efd8ab8ccf233dc06bcaf50b5a3ee774f','2025-10-13 05:25:15.038158','2025-10-13 05:25:15.038158'); +/*!40000 ALTER TABLE `ar_internal_metadata` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `clarifications` +-- + +DROP TABLE IF EXISTS `clarifications`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `clarifications` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `contest_id` bigint(20) NOT NULL, + `problem_id` bigint(20) DEFAULT NULL, + `user_id` bigint(20) NOT NULL, + `question` varchar(255) NOT NULL, + `answer` varchar(255) DEFAULT NULL, + `publish` tinyint(1) NOT NULL DEFAULT '0', + `created_at` datetime(6) NOT NULL, + `updated_at` datetime(6) NOT NULL, + `deleted_at` datetime DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `index_clarifications_on_contest_id` (`contest_id`), + KEY `index_clarifications_on_problem_id` (`problem_id`), + KEY `index_clarifications_on_user_id` (`user_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `clarifications` +-- + +LOCK TABLES `clarifications` WRITE; +/*!40000 ALTER TABLE `clarifications` DISABLE KEYS */; +/*!40000 ALTER TABLE `clarifications` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `contest_admins` +-- + +DROP TABLE IF EXISTS `contest_admins`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `contest_admins` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `contest_id` bigint(20) NOT NULL, + `user_id` bigint(20) NOT NULL, + `created_at` datetime(6) NOT NULL, + `updated_at` datetime(6) NOT NULL, + `deleted_at` datetime DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `index_contest_admins_on_contest_id` (`contest_id`), + KEY `index_contest_admins_on_user_id` (`user_id`), + CONSTRAINT `fk_rails_2bcd01ae0f` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`), + CONSTRAINT `fk_rails_bc420dfd71` FOREIGN KEY (`contest_id`) REFERENCES `contests` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `contest_admins` +-- + +LOCK TABLES `contest_admins` WRITE; +/*!40000 ALTER TABLE `contest_admins` DISABLE KEYS */; +INSERT INTO `contest_admins` VALUES (1,1,1,'2025-10-13 05:25:16.099839','2025-10-13 05:25:16.099839',NULL),(2,2,1,'2025-10-13 05:25:16.103389','2025-10-13 05:25:16.103389',NULL),(3,3,1,'2025-10-13 05:25:16.108812','2025-10-13 05:25:16.108812',NULL); +/*!40000 ALTER TABLE `contest_admins` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `contests` +-- + +DROP TABLE IF EXISTS `contests`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `contests` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `slug` varchar(255) NOT NULL, + `name` varchar(255) NOT NULL, + `description` varchar(4096) DEFAULT NULL, + `kind` varchar(255) NOT NULL DEFAULT 'normal', + `allow_open_registration` tinyint(1) DEFAULT '0', + `closed_password` varchar(255) DEFAULT NULL, + `allow_team_registration` tinyint(1) DEFAULT '0', + `standings_mode` int(11) NOT NULL DEFAULT '1', + `penalty_time` int(11) NOT NULL DEFAULT '0', + `start_at` datetime DEFAULT NULL, + `end_at` datetime DEFAULT NULL, + `permanent` tinyint(1) NOT NULL DEFAULT '0', + `editorial_url` varchar(255) DEFAULT NULL, + `official_mode` tinyint(1) NOT NULL DEFAULT '0', + `created_at` datetime(6) NOT NULL, + `updated_at` datetime(6) NOT NULL, + `deleted_at` datetime DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `index_contests_on_slug` (`slug`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `contests` +-- + +LOCK TABLES `contests` WRITE; +/*!40000 ALTER TABLE `contests` DISABLE KEYS */; +INSERT INTO `contests` VALUES (1,'sample-contest-2024','Sample Contest 2024','これはサンプルコンテストです。','normal',1,NULL,0,1,5,'2025-09-13 05:25:15','2025-09-13 08:25:15',0,NULL,1,'2025-10-13 05:25:15.944200','2025-10-13 05:25:15.944200',NULL),(2,'upcoming-contest','Upcoming Contest','これから開催されるコンテストです。','normal',1,NULL,1,1,5,'2025-10-20 05:25:15','2025-10-20 08:25:15',0,NULL,1,'2025-10-13 05:25:15.946587','2025-10-13 05:25:15.946587',NULL),(3,'practice','Practice Contest','練習用のコンテストです。いつでも参加できます。','normal',1,NULL,0,1,0,'2024-10-13 05:25:15',NULL,1,NULL,0,'2025-10-13 05:25:15.948988','2025-10-13 05:25:15.948988',NULL); +/*!40000 ALTER TABLE `contests` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `posts` +-- + +DROP TABLE IF EXISTS `posts`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `posts` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `title` varchar(255) NOT NULL, + `content` text NOT NULL, + `public_status` varchar(255) DEFAULT 'private', + `created_at` datetime(6) NOT NULL, + `updated_at` datetime(6) NOT NULL, + `deleted_at` datetime DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `posts` +-- + +LOCK TABLES `posts` WRITE; +/*!40000 ALTER TABLE `posts` DISABLE KEYS */; +INSERT INTO `posts` VALUES (1,'サイトオープンのお知らせ','競技プログラミングオンラインジャッジサイトがオープンしました!\n\nこのサイトでは以下のことができます:\n- プログラミングコンテストに参加\n- 問題の練習\n- 他の参加者との交流\n\nぜひご利用ください!','public','2025-10-13 05:25:16.113386','2025-10-13 05:25:16.113386',NULL),(2,'初回コンテスト開催のお知らせ','記念すべき第1回コンテストを開催します!\n\n日時:来週の土曜日 20:00-23:00\n難易度:初心者〜中級者向け\n\n皆様のご参加をお待ちしております。','public','2025-10-13 05:25:16.115656','2025-10-13 05:25:16.115656',NULL); +/*!40000 ALTER TABLE `posts` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `problems` +-- + +DROP TABLE IF EXISTS `problems`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `problems` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `slug` varchar(255) DEFAULT NULL, + `name` varchar(255) DEFAULT NULL, + `contest_id` bigint(20) DEFAULT NULL, + `writer_user_id` bigint(20) NOT NULL DEFAULT '1', + `position` varchar(4) DEFAULT NULL, + `uuid` varchar(255) DEFAULT NULL, + `difficulty` varchar(16) NOT NULL, + `execution_time_limit` int(11) NOT NULL DEFAULT '2000', + `submission_limit_1` int(11) NOT NULL DEFAULT '5', + `submission_limit_2` int(11) NOT NULL DEFAULT '60', + `statement` varchar(4096) NOT NULL, + `constraints` varchar(2048) NOT NULL, + `partial_scores` varchar(4096) DEFAULT NULL, + `input_format` varchar(1024) NOT NULL, + `output_format` varchar(1024) NOT NULL, + `checker_path` varchar(255) DEFAULT NULL, + `created_at` datetime(6) NOT NULL, + `updated_at` datetime(6) NOT NULL, + `deleted_at` datetime DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `index_problems_on_slug` (`slug`), + KEY `index_problems_on_contest_id` (`contest_id`), + KEY `index_problems_on_writer_user_id` (`writer_user_id`), + CONSTRAINT `fk_rails_82fc22963d` FOREIGN KEY (`writer_user_id`) REFERENCES `users` (`id`), + CONSTRAINT `fk_rails_ee26900320` FOREIGN KEY (`contest_id`) REFERENCES `contests` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `problems` +-- + +LOCK TABLES `problems` WRITE; +/*!40000 ALTER TABLE `problems` DISABLE KEYS */; +INSERT INTO `problems` VALUES (1,'sample-a','A + B Problem',1,7,'A','6e0c3c75-4b9f-4216-8887-b2bfca0612b1','beginner',2000,5,60,'2つの整数 A, B が与えられます。A + B を出力してください。','1 ≤ A, B ≤ 1000',NULL,'A B','A + B の値',NULL,'2025-10-13 05:25:15.969911','2025-10-13 05:25:15.969911',NULL),(2,'sample-b','Factorial',1,7,'B','89522788-6aef-4cad-92a7-85fbf2706087','easy',2000,5,60,'正の整数 N が与えられます。N! (N の階乗) を出力してください。','1 ≤ N ≤ 10',NULL,'N','N! の値',NULL,'2025-10-13 05:25:15.974222','2025-10-13 05:25:15.974222',NULL),(3,'hello-world','Hello World',3,7,'A','1932206f-7d48-4cff-bf1f-593b842e5ff7','beginner',1000,10,100,'\"Hello World\" を出力してください。','特になし',NULL,'入力はありません。','Hello World',NULL,'2025-10-13 05:25:15.978543','2025-10-13 05:25:15.978543',NULL); +/*!40000 ALTER TABLE `problems` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `registrations` +-- + +DROP TABLE IF EXISTS `registrations`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `registrations` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `user_id` bigint(20) NOT NULL, + `contest_id` bigint(20) NOT NULL, + `open_registration` tinyint(1) DEFAULT '0', + `created_at` datetime(6) NOT NULL, + `updated_at` datetime(6) NOT NULL, + `deleted_at` datetime DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `index_registrations_on_contest_id` (`contest_id`), + KEY `index_registrations_on_user_id` (`user_id`) +) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `registrations` +-- + +LOCK TABLES `registrations` WRITE; +/*!40000 ALTER TABLE `registrations` DISABLE KEYS */; +INSERT INTO `registrations` VALUES (1,2,1,1,'2025-10-13 05:25:16.051046','2025-10-13 05:25:16.051046',NULL),(2,3,1,1,'2025-10-13 05:25:16.055772','2025-10-13 05:25:16.055772',NULL),(3,4,1,1,'2025-10-13 05:25:16.062995','2025-10-13 05:25:16.062995',NULL),(4,5,1,1,'2025-10-13 05:25:16.067180','2025-10-13 05:25:16.067180',NULL),(5,6,1,1,'2025-10-13 05:25:16.071137','2025-10-13 05:25:16.071137',NULL),(6,8,2,0,'2025-10-13 05:31:18.479986','2025-10-13 05:31:20.260282','2025-10-13 05:31:20'); +/*!40000 ALTER TABLE `registrations` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `schema_migrations` +-- + +DROP TABLE IF EXISTS `schema_migrations`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `schema_migrations` ( + `version` varchar(255) NOT NULL, + PRIMARY KEY (`version`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `schema_migrations` +-- + +LOCK TABLES `schema_migrations` WRITE; +/*!40000 ALTER TABLE `schema_migrations` DISABLE KEYS */; +INSERT INTO `schema_migrations` VALUES ('20200308052138'),('20200308054343'),('20200308062829'),('20200308064425'),('20200308065054'),('20200308065322'),('20200308070154'),('20200308071634'),('20200308072023'),('20200308094139'),('20200309111003'),('20200310120054'),('20200310130429'),('20200313234204'),('20200313234837'),('20200314040017'),('20200314040140'),('20200314052536'),('20200314093939'),('20200314104609'),('20200314105209'),('20200317155418'),('20200319153251'),('20200320035620'),('20200825133952'),('20200829075559'),('20200830065702'),('20200914092327'),('20200915074315'),('20200920152509'),('20201011124217'),('20201205081335'),('20201227133128'),('20210128100339'),('20210320075120'),('20210513112953'),('20210517121148'),('20210519001850'),('20210601092755'),('20230529190733'),('20230803084505'),('20230816092450'),('20230829190732'),('20230829191216'),('20230829191311'),('20230829192330'),('20240211112918'),('20240226193904'),('20240624120459'),('20240630153938'),('20240708090533'),('20240818051742'),('20240818054102'),('20241103122636'),('20241104132845'); +/*!40000 ALTER TABLE `schema_migrations` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `submissions` +-- + +DROP TABLE IF EXISTS `submissions`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `submissions` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `user_id` int(11) NOT NULL, + `problem_id` bigint(20) NOT NULL, + `path` varchar(255) NOT NULL, + `status` varchar(16) NOT NULL, + `point` int(11) DEFAULT NULL, + `execution_time` int(11) DEFAULT NULL, + `execution_memory` int(11) DEFAULT NULL, + `compile_error` text, + `lang` varchar(255) NOT NULL, + `public` tinyint(1) NOT NULL DEFAULT '1', + `created_at` datetime(6) NOT NULL, + `updated_at` datetime(6) NOT NULL, + `deleted_at` datetime DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `index_submissions_on_problem_id` (`problem_id`), + KEY `index_submissions_on_user_id` (`user_id`), + CONSTRAINT `fk_rails_0734ef156b` FOREIGN KEY (`problem_id`) REFERENCES `problems` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `submissions` +-- + +LOCK TABLES `submissions` WRITE; +/*!40000 ALTER TABLE `submissions` DISABLE KEYS */; +INSERT INTO `submissions` VALUES (1,2,1,'submissions/2/1/main.cpp','AC',100,546,38576,NULL,'cpp',1,'2025-10-13 05:25:16.081393','2025-10-13 05:25:16.081393',NULL),(2,3,1,'submissions/3/1/main.cpp','WA',0,1241,30010,NULL,'cpp',1,'2025-10-13 05:25:16.085338','2025-10-13 05:25:16.085338',NULL),(3,4,1,'submissions/4/1/main.cpp','TLE',0,1336,38295,NULL,'cpp',1,'2025-10-13 05:25:16.092419','2025-10-13 05:25:16.092419',NULL); +/*!40000 ALTER TABLE `submissions` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `team_registration_users` +-- + +DROP TABLE IF EXISTS `team_registration_users`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `team_registration_users` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `user_id` bigint(20) NOT NULL, + `team_registration_id` bigint(20) NOT NULL, + `created_at` datetime(6) NOT NULL, + `updated_at` datetime(6) NOT NULL, + `deleted_at` datetime DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `index_team_registration_users_on_ids` (`user_id`,`team_registration_id`), + KEY `index_team_registration_users_on_team_registration_id` (`team_registration_id`), + KEY `index_team_registration_users_on_user_id` (`user_id`), + CONSTRAINT `fk_rails_472e602820` FOREIGN KEY (`team_registration_id`) REFERENCES `team_registrations` (`id`), + CONSTRAINT `fk_rails_a4a648fb05` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `team_registration_users` +-- + +LOCK TABLES `team_registration_users` WRITE; +/*!40000 ALTER TABLE `team_registration_users` DISABLE KEYS */; +/*!40000 ALTER TABLE `team_registration_users` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `team_registrations` +-- + +DROP TABLE IF EXISTS `team_registrations`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `team_registrations` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `contest_id` bigint(20) NOT NULL, + `name` varchar(255) DEFAULT NULL, + `passphrase` varchar(255) DEFAULT NULL, + `open_registration` tinyint(1) NOT NULL, + `created_at` datetime(6) NOT NULL, + `updated_at` datetime(6) NOT NULL, + `deleted_at` datetime DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `index_team_registrations_on_contest_id` (`contest_id`), + CONSTRAINT `fk_rails_299d73f60b` FOREIGN KEY (`contest_id`) REFERENCES `contests` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `team_registrations` +-- + +LOCK TABLES `team_registrations` WRITE; +/*!40000 ALTER TABLE `team_registrations` DISABLE KEYS */; +/*!40000 ALTER TABLE `team_registrations` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `testcase_results` +-- + +DROP TABLE IF EXISTS `testcase_results`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `testcase_results` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `submission_id` bigint(20) NOT NULL, + `testcase_id` bigint(20) NOT NULL, + `status` varchar(16) NOT NULL, + `score` bigint(20) DEFAULT NULL, + `execution_time` int(11) NOT NULL, + `execution_memory` int(11) NOT NULL, + `created_at` datetime(6) NOT NULL, + `updated_at` datetime(6) NOT NULL, + `deleted_at` datetime DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `index_testcase_results_on_submission_id` (`submission_id`), + KEY `index_testcase_results_on_testcase_id` (`testcase_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `testcase_results` +-- + +LOCK TABLES `testcase_results` WRITE; +/*!40000 ALTER TABLE `testcase_results` DISABLE KEYS */; +/*!40000 ALTER TABLE `testcase_results` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `testcase_sets` +-- + +DROP TABLE IF EXISTS `testcase_sets`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `testcase_sets` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `problem_id` bigint(20) NOT NULL, + `name` varchar(255) NOT NULL, + `points` int(11) NOT NULL, + `aggregate_type` int(11) NOT NULL DEFAULT '0', + `is_sample` tinyint(1) NOT NULL, + `created_at` datetime(6) NOT NULL, + `updated_at` datetime(6) NOT NULL, + `deleted_at` datetime DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `index_testcase_sets_on_problem_id` (`problem_id`), + CONSTRAINT `fk_rails_9606b8a9e5` FOREIGN KEY (`problem_id`) REFERENCES `problems` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `testcase_sets` +-- + +LOCK TABLES `testcase_sets` WRITE; +/*!40000 ALTER TABLE `testcase_sets` DISABLE KEYS */; +INSERT INTO `testcase_sets` VALUES (1,1,'All',100,0,1,'2025-10-13 05:25:16.012018','2025-10-13 05:25:16.012018',NULL),(2,2,'All',100,0,1,'2025-10-13 05:25:16.014203','2025-10-13 05:25:16.014203',NULL),(3,3,'All',100,0,1,'2025-10-13 05:25:16.016409','2025-10-13 05:25:16.016409',NULL); +/*!40000 ALTER TABLE `testcase_sets` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `testcase_testcase_sets` +-- + +DROP TABLE IF EXISTS `testcase_testcase_sets`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `testcase_testcase_sets` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `testcase_id` bigint(20) NOT NULL, + `testcase_set_id` bigint(20) NOT NULL, + `created_at` datetime(6) NOT NULL, + `updated_at` datetime(6) NOT NULL, + `deleted_at` datetime DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `index_testcase_testcase_sets_on_testcase_id` (`testcase_id`), + KEY `index_testcase_testcase_sets_on_testcase_set_id` (`testcase_set_id`), + CONSTRAINT `fk_rails_400d292f6a` FOREIGN KEY (`testcase_id`) REFERENCES `testcases` (`id`), + CONSTRAINT `fk_rails_dc4fbe8a3c` FOREIGN KEY (`testcase_set_id`) REFERENCES `testcase_sets` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `testcase_testcase_sets` +-- + +LOCK TABLES `testcase_testcase_sets` WRITE; +/*!40000 ALTER TABLE `testcase_testcase_sets` DISABLE KEYS */; +INSERT INTO `testcase_testcase_sets` VALUES (1,1,1,'2025-10-13 05:25:16.025824','2025-10-13 05:25:16.025824',NULL),(2,2,1,'2025-10-13 05:25:16.029652','2025-10-13 05:25:16.029652',NULL),(3,3,2,'2025-10-13 05:25:16.036473','2025-10-13 05:25:16.036473',NULL),(4,4,2,'2025-10-13 05:25:16.040400','2025-10-13 05:25:16.040400',NULL),(5,5,3,'2025-10-13 05:25:16.043988','2025-10-13 05:25:16.043988',NULL); +/*!40000 ALTER TABLE `testcase_testcase_sets` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `testcases` +-- + +DROP TABLE IF EXISTS `testcases`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `testcases` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `problem_id` bigint(20) NOT NULL DEFAULT '1', + `name` varchar(255) DEFAULT NULL, + `input` longtext, + `output` longtext, + `explanation` varchar(2048) DEFAULT NULL, + `created_at` datetime(6) NOT NULL, + `updated_at` datetime(6) NOT NULL, + `deleted_at` datetime DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `index_testcases_on_problem_id` (`problem_id`), + CONSTRAINT `fk_rails_740afe3d3a` FOREIGN KEY (`problem_id`) REFERENCES `problems` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `testcases` +-- + +LOCK TABLES `testcases` WRITE; +/*!40000 ALTER TABLE `testcases` DISABLE KEYS */; +INSERT INTO `testcases` VALUES (1,1,'sample_01','1 2','3','1 + 2 = 3','2025-10-13 05:25:15.986995','2025-10-13 05:25:15.986995',NULL),(2,1,'sample_02','100 200','300','100 + 200 = 300','2025-10-13 05:25:15.991590','2025-10-13 05:25:15.991590',NULL),(3,2,'sample_01','3','6','3! = 3 × 2 × 1 = 6','2025-10-13 05:25:15.994347','2025-10-13 05:25:15.994347',NULL),(4,2,'sample_02','5','120','5! = 5 × 4 × 3 × 2 × 1 = 120','2025-10-13 05:25:16.000691','2025-10-13 05:25:16.000691',NULL),(5,3,'sample_01','','Hello World','Hello World を出力する','2025-10-13 05:25:16.003572','2025-10-13 05:25:16.003572',NULL); +/*!40000 ALTER TABLE `testcases` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `tester_relations` +-- + +DROP TABLE IF EXISTS `tester_relations`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `tester_relations` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `problem_id` bigint(20) NOT NULL, + `tester_user_id` bigint(20) NOT NULL, + `approved` tinyint(1) NOT NULL, + `created_at` datetime(6) NOT NULL, + `updated_at` datetime(6) NOT NULL, + `deleted_at` datetime DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `index_tester_relations_on_problem_id` (`problem_id`), + KEY `index_tester_relations_on_tester_user_id` (`tester_user_id`), + CONSTRAINT `fk_rails_0b6cb25bec` FOREIGN KEY (`tester_user_id`) REFERENCES `users` (`id`), + CONSTRAINT `fk_rails_34f1f29dce` FOREIGN KEY (`problem_id`) REFERENCES `problems` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `tester_relations` +-- + +LOCK TABLES `tester_relations` WRITE; +/*!40000 ALTER TABLE `tester_relations` DISABLE KEYS */; +/*!40000 ALTER TABLE `tester_relations` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Table structure for table `users` +-- + +DROP TABLE IF EXISTS `users`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `users` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `provider` varchar(255) NOT NULL DEFAULT 'email', + `uid` varchar(255) NOT NULL DEFAULT '', + `encrypted_password` varchar(255) NOT NULL DEFAULT '', + `reset_password_token` varchar(255) DEFAULT NULL, + `reset_password_sent_at` datetime DEFAULT NULL, + `allow_password_change` tinyint(1) DEFAULT '0', + `remember_created_at` datetime DEFAULT NULL, + `sign_in_count` int(11) NOT NULL DEFAULT '0', + `current_sign_in_at` datetime DEFAULT NULL, + `last_sign_in_at` datetime DEFAULT NULL, + `current_sign_in_ip` varchar(255) DEFAULT NULL, + `last_sign_in_ip` varchar(255) DEFAULT NULL, + `confirmation_token` varchar(255) DEFAULT NULL, + `confirmed_at` datetime DEFAULT NULL, + `confirmation_sent_at` datetime DEFAULT NULL, + `unconfirmed_email` varchar(255) DEFAULT NULL, + `role` varchar(255) NOT NULL DEFAULT 'member', + `name` varchar(255) DEFAULT NULL, + `atcoder_id` varchar(16) DEFAULT NULL, + `atcoder_rating` int(11) DEFAULT NULL, + `writer_request_code` varchar(255) DEFAULT NULL, + `email` varchar(255) DEFAULT NULL, + `tokens` text, + `created_at` datetime(6) NOT NULL, + `updated_at` datetime(6) NOT NULL, + `deleted_at` datetime DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `index_users_on_uid_and_provider` (`uid`,`provider`), + UNIQUE KEY `index_users_on_confirmation_token` (`confirmation_token`), + UNIQUE KEY `index_users_on_email` (`email`), + UNIQUE KEY `index_users_on_name` (`name`), + UNIQUE KEY `index_users_on_reset_password_token` (`reset_password_token`) +) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Dumping data for table `users` +-- + +LOCK TABLES `users` WRITE; +/*!40000 ALTER TABLE `users` DISABLE KEYS */; +INSERT INTO `users` VALUES (1,'email','admin@example.com','$2a$11$GvBKPQon3ltxl5BAMBywRePvLV6HfWfqfe4cxZIIdAuiejchdt8wS',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,'2025-10-13 05:25:15',NULL,NULL,'admin','admin',NULL,NULL,NULL,'admin@example.com',NULL,'2025-10-13 05:25:15.425381','2025-10-13 05:25:15.425381',NULL),(2,'email','user1@example.com','$2a$11$WwagUYWw38sYuyVme0QqUuQNvRbseKrKEuvoTay.dDfZqmEp19QeS',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,'2025-10-13 05:25:15',NULL,NULL,'member','user1','user1',2296,NULL,'user1@example.com',NULL,'2025-10-13 05:25:15.509505','2025-10-13 05:25:15.509505',NULL),(3,'email','user2@example.com','$2a$11$9hREPQL5zLNJ6oAponNwae5/3Oof/nU5.w48KmBT2n7dj9rMifqTO',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,'2025-10-13 05:25:15',NULL,NULL,'member','user2','user2',2099,NULL,'user2@example.com',NULL,'2025-10-13 05:25:15.593187','2025-10-13 05:25:15.593187',NULL),(4,'email','user3@example.com','$2a$11$uPeT015KNyzybhXhjVl6Y.9vvTj.BRvxRi9r7UDtY9dO7xhUWPNSW',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,'2025-10-13 05:25:15',NULL,NULL,'member','user3','user3',1803,NULL,'user3@example.com',NULL,'2025-10-13 05:25:15.677599','2025-10-13 05:25:15.677599',NULL),(5,'email','user4@example.com','$2a$11$yWH9b0zLd3CmnswwTyVvtubR2UE6RpFnZSpsuqouWG.syhy0nW5cG',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,'2025-10-13 05:25:15',NULL,NULL,'member','user4','user4',1684,NULL,'user4@example.com',NULL,'2025-10-13 05:25:15.761877','2025-10-13 05:25:15.761877',NULL),(6,'email','user5@example.com','$2a$11$bvOcFffS6ZJTvLFkIbqBj.3AfwgmZQwp/D7D.WzpzXwuAqFq0L.Sm',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,'2025-10-13 05:25:15',NULL,NULL,'member','user5','user5',1387,NULL,'user5@example.com',NULL,'2025-10-13 05:25:15.848405','2025-10-13 05:25:15.848405',NULL),(7,'email','writer@example.com','$2a$11$DV35zI.qBDmws9EiLpD82eSnVaOuN.X3RRkd8C76rmePzgZ/EQ/9C',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,'2025-10-13 05:25:15',NULL,NULL,'writer','writer',NULL,NULL,NULL,'writer@example.com',NULL,'2025-10-13 05:25:15.932604','2025-10-13 05:25:15.932604',NULL),(8,'email','matsumotomate0606@gmail.com','$2a$11$BB30R8h9sw7YnzULcEL3o.d/.C7fO17D2fK9xQ8gGc8AlKAF2hbgS',NULL,NULL,0,NULL,0,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'member','manabeai',NULL,NULL,NULL,'matsumotomate0606@gmail.com','{\"Na8SDwxNq45HebU-yJ0k2w\":{\"token\":\"$2a$10$Rt6EgBfW1tBNvwRva85PteY8awXiIwpe4Bzs.Y7sZv6FJ4wKBU8qK\",\"expiry\":1762752670}}','2025-10-13 05:31:10.392772','2025-10-13 05:31:10.437329',NULL); +/*!40000 ALTER TABLE `users` ENABLE KEYS */; +UNLOCK TABLES; + +-- +-- Current Database: `cafecoder_back_rails_development` +-- + +USE `cafecoder_back_rails_development`; + +-- +-- Final view structure for view `all_registrations` +-- + +/*!50001 DROP VIEW IF EXISTS `all_registrations`*/; +/*!50001 SET @saved_cs_client = @@character_set_client */; +/*!50001 SET @saved_cs_results = @@character_set_results */; +/*!50001 SET @saved_col_connection = @@collation_connection */; +/*!50001 SET character_set_client = utf8mb4 */; +/*!50001 SET character_set_results = utf8mb4 */; +/*!50001 SET collation_connection = utf8mb4_general_ci */; +/*!50001 CREATE ALGORITHM=UNDEFINED */ +/*!50013 DEFINER=`root`@`%` SQL SECURITY DEFINER */ +/*!50001 VIEW `all_registrations` AS select `registrations`.`id` AS `id`,`registrations`.`contest_id` AS `contest_id`,`registrations`.`open_registration` AS `open_registration`,`registrations`.`created_at` AS `created_at`,`registrations`.`updated_at` AS `updated_at`,`registrations`.`deleted_at` AS `deleted_at`,'individual' AS `type` from `registrations` union select `team_registrations`.`id` AS `id`,`team_registrations`.`contest_id` AS `contest_id`,`team_registrations`.`open_registration` AS `open_registration`,`team_registrations`.`created_at` AS `created_at`,`team_registrations`.`updated_at` AS `updated_at`,`team_registrations`.`deleted_at` AS `deleted_at`,'team' AS `type` from `team_registrations` */; +/*!50001 SET character_set_client = @saved_cs_client */; +/*!50001 SET character_set_results = @saved_cs_results */; +/*!50001 SET collation_connection = @saved_col_connection */; +/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; + +-- Dump completed on 2025-10-13 14:47:44