Skip to content

Commit

Permalink
fix init
Browse files Browse the repository at this point in the history
  • Loading branch information
TimoxGagarin committed Apr 24, 2024
1 parent 10e7a22 commit 907500d
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 63 deletions.
47 changes: 20 additions & 27 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,30 @@
name: SonarCloud
name: Render Spring POC hook example

on:
push:
branches:
- main
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:

jobs:
build:
name: Build and analyze
build-and-deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- uses: actions/checkout@v2

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: 17
distribution: "zulu" # Alternative distribution options are available.
- name: Cache SonarCloud packages
uses: actions/cache@v3
uses: actions/setup-java@v2
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache Maven packages
uses: actions/cache@v3
java-version: "17"
distribution: "adopt"

- name: Build with Gradle
uses: gradle/gradle-build-action@v2
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Build and analyze //
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn -B verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=fozboom_book-library-java
tasks: build
java-home: ${{ env.JAVA_HOME_17_X64 }}
publish-atoms: false

- name: Trigger Render deploy hook
run: curl ${{secrets.RENDER_DEPLOY_HOOK}}
78 changes: 42 additions & 36 deletions init.sql
Original file line number Diff line number Diff line change
@@ -1,41 +1,47 @@
create table city (
id bigint not null,
country varchar(255),
country_code varchar(255),
name varchar(255),
region varchar(255),
region_name varchar(255),
zip varchar(255),
primary key (id)
CREATE SEQUENCE city_sequence START 1 INCREMENT 1;
CREATE SEQUENCE ipinfo_sequence START 1 INCREMENT 1;
CREATE SEQUENCE position_sequence START 1 INCREMENT 1;
CREATE SEQUENCE provider_sequence START 1 INCREMENT 1;

CREATE TABLE city (
id BIGINT PRIMARY KEY DEFAULT nextval('city_sequence'),
country VARCHAR(255) NOT NULL,
country_code VARCHAR(2) NOT NULL,
region VARCHAR(255) NOT NULL,
region_name VARCHAR(255) NOT NULL,
name VARCHAR(255) NOT NULL,
zip VARCHAR(255) NOT NULL
);
create table city_provider_relation (
city_id bigint not null,
provider_id bigint not null,
primary key (city_id, provider_id)

CREATE TABLE position (
id BIGINT PRIMARY KEY DEFAULT nextval('position_sequence'),
latitude NUMERIC(10, 8) NOT NULL,
longitude NUMERIC(11, 8) NOT NULL
);

create table ip_info (
city_id bigint,
id bigint not null,
position_id bigint,
provider_id bigint,
ip varchar(255),
time_zone varchar(255),
primary key (id)

CREATE TABLE provider (
id BIGINT PRIMARY KEY DEFAULT nextval('provider_sequence'),
internet_service_provider VARCHAR(255) NOT NULL,
organisation VARCHAR(255) NOT NULL,
autonomous_system_name VARCHAR(255) NOT NULL
);

create table position (
latitude float(53),
longitude float(53),
id bigint not null,
primary key (id)

CREATE TABLE city_provider_relation (
provider_id BIGINT NOT NULL,
city_id BIGINT NOT NULL,
PRIMARY KEY (provider_id, city_id),
FOREIGN KEY (provider_id) REFERENCES provider(id),
FOREIGN KEY (city_id) REFERENCES city(id)
);

create table provider (
id bigint not null,
autonomous_system_name varchar(255),
internet_service_provider varchar(255),
organisation varchar(255),
primary key (id)

CREATE TABLE ip_info (
id BIGINT PRIMARY KEY DEFAULT nextval('ipinfo_sequence'),
city_id BIGINT NOT NULL,
position_id BIGINT NOT NULL,
time_zone VARCHAR(255) NOT NULL,
provider_id BIGINT NOT NULL,
ip VARCHAR(255) NOT NULL,
FOREIGN KEY (city_id) REFERENCES city(id),
FOREIGN KEY (position_id) REFERENCES position(id),
FOREIGN KEY (provider_id) REFERENCES provider(id)
);
2 changes: 2 additions & 0 deletions logs.log
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
INFO: Log message
апр. 24, 2024 7:33:58 PM com.ip_position.ipposition.logger.LoggerAspect <init>
INFO: Log message
апр. 24, 2024 9:26:22 PM com.ip_position.ipposition.logger.LoggerAspect <init>
INFO: Log message

0 comments on commit 907500d

Please sign in to comment.